bp_friends_activity_at_name_do_notifications( bool $send, array $usernames, int $user_id, BP_Activity_Activity $activity )
Stop sending notification when user mentioned in activity and not in friend list.
Description
Parameters
- $send
-
(bool) (Required) Whether or not BuddyBoss should send a notification to the mentioned users.
- $usernames
-
(array) (Required) Array of users potentially notified.
- $user_id
-
(int) (Required) ID of the current user being notified.
- $activity
-
(BP_Activity_Activity) (Required) Activity object.
Return
(bool)
Source
File: bp-friends/bp-friends-activity.php
function bp_friends_activity_at_name_do_notifications( $send, $usernames, $user_id, $activity ) { if ( 'friends' !== $activity->privacy ) { return $send; } $friends = friends_get_friend_user_ids( $activity->user_id ); if ( ! empty( $friends ) && in_array( $user_id, $friends ) ) { return $send; } return false; }
Changelog
Version | Description |
---|---|
BuddyBoss 1.4.3 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.