bp_blogs_remove_data

Remove all blog associations for a given user.

Description

bp_blogs_remove_data( (int) $user_id ); 

Parameters (1)

0. $user_id (int)
ID whose blog data should be removed.

Usage

  1. if ( !function_exists( 'bp_blogs_remove_data' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-functions.php'; 
  3.  
  4. // ID whose blog data should be removed. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_blogs_remove_data($user_id); 
  9.  

Defined (1)

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

/bp-blogs/bp-blogs-functions.php  
  1. function bp_blogs_remove_data( $user_id ) { 
  2. if ( !is_multisite() ) 
  3. return false; 
  4.  
  5. /** 
  6. * Fires before all blog associations are removed for a given user. 
  7. * @since 1.5.0 
  8. * @param int $user_id ID of the user whose blog associations are being removed. 
  9. */ 
  10.  
  11. // If this is regular blog, delete all data for that blog. 
  12. BP_Blogs_Blog::delete_blogs_for_user( $user_id ); 
  13.  
  14. /** 
  15. * Fires after all blog associations are removed for a given user. 
  16. * @since 1.0.0 
  17. * @param int $user_id ID of the user whose blog associations were removed. 
  18. */