bp_friends_remove_notifications_data

Remove friendship requests FROM user, used primarily when a user is deleted.

Description

bp_friends_remove_notifications_data( (int) $user_id = 0 ); 

Parameters (1)

0. $user_id — Optional. (int)
ID of the user whose notifications are removed.

Usage

  1. if ( !function_exists( 'bp_friends_remove_notifications_data' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-friends/bp-friends-notifications.php'; 
  3.  
  4. // ID of the user whose notifications are removed. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_friends_remove_notifications_data($user_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-friends/bp-friends-notifications.php  
  1. function bp_friends_remove_notifications_data( $user_id = 0 ) { 
  2. bp_notifications_delete_notifications_from_user( $user_id,buddypress)->friends->id, 'friendship_request' );