bp_blogs_remove_user_from_blog

Remove a blog-user pair from BP's blog tracker.

Description

bp_blogs_remove_user_from_blog( (int) $user_id, (int) $blog_id = 0 ); 

Parameters (2)

0. $user_id (int)
ID of the user whose blog is being removed.
1. $blog_id — Optional. (int)
ID of the blog being removed. Default: current blog ID.

Usage

  1. if ( !function_exists( 'bp_blogs_remove_user_from_blog' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-functions.php'; 
  3.  
  4. // ID of the user whose blog is being removed. 
  5. $user_id = -1; 
  6.  
  7. // Optional. ID of the blog being removed. Default: current blog ID. 
  8. $blog_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_blogs_remove_user_from_blog($user_id, $blog_id); 
  12.  

Defined (1)

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

/bp-blogs/bp-blogs-functions.php  
  1. function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) { 
  2. global $wpdb; 
  3.  
  4. if ( empty( $blog_id ) ) { 
  5. $blog_id = $wpdb->blogid; 
  6.  
  7. bp_blogs_remove_blog_for_user( $user_id, $blog_id );