diff --git src/bp-groups/bp-groups-notifications.php src/bp-groups/bp-groups-notifications.php
index 481c70770..b9759d787 100644
|
|
function bp_groups_delete_group_delete_all_notifications( $group_id ) { |
962 | 962 | } |
963 | 963 | add_action( 'groups_delete_group', 'bp_groups_delete_group_delete_all_notifications', 10 ); |
964 | 964 | |
| 965 | /** |
| 966 | * Remove Group invite notification when a user is uninvited. |
| 967 | * |
| 968 | * @since 5.0.0 |
| 969 | * |
| 970 | * @param int $group_id ID of the group being uninvited from. |
| 971 | * @param int $user_id ID of the user being uninvited. |
| 972 | */ |
| 973 | function bp_groups_uninvite_user_delete_group_invite_notification( $group_id = 0, $user_id = 0 ) { |
| 974 | if ( ! bp_is_active( 'notifications' ) || ! $group_id || ! $user_id ) { |
| 975 | return; |
| 976 | } |
| 977 | |
| 978 | bp_notifications_delete_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' ); |
| 979 | } |
| 980 | add_action( 'groups_uninvite_user', 'bp_groups_uninvite_user_delete_group_invite_notification', 10, 2 ); |
| 981 | |
965 | 982 | /** |
966 | 983 | * When a demotion takes place, delete any corresponding promotion notifications. |
967 | 984 | * |