bp_core_delete_avatar_on_user_delete

Delete a user's avatar when the user is deleted.

Description

bp_core_delete_avatar_on_user_delete( (int) $user_id ); 

Parameters (1)

0. $user_id (int)
ID of the user who is about to be deleted.

Usage

  1. if ( !function_exists( 'bp_core_delete_avatar_on_user_delete' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-members/bp-members-functions.php'; 
  3.  
  4. // ID of the user who is about to be deleted. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_delete_avatar_on_user_delete($user_id); 
  9.  

Defined (1)

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

/bp-members/bp-members-functions.php  
  1. function bp_core_delete_avatar_on_user_delete( $user_id ) { 
  2. 'item_id' => $user_id,  
  3. 'object' => 'user',  
  4. ) );