bp_friends_delete_activity_on_user_delete

Deletes friendship activity items when a user is deleted.

Description

bp_friends_delete_activity_on_user_delete( (int) $user_id = 0 ); 

Parameters (1)

0. $user_id — Optional. (int)
The ID of the user being deleted.

Usage

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

Defined (1)

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

/bp-friends/bp-friends-activity.php  
  1. function bp_friends_delete_activity_on_user_delete( $user_id = 0 ) { 
  2. if ( ! bp_is_active( 'activity' ) ) { 
  3. return; 
  4.  
  5. 'component' =>buddypress)->friends->id,  
  6. 'type' => 'friendship_created',  
  7. 'secondary_item_id' => $user_id 
  8. ) );