bp_blogs_remove_blog_for_user

Remove a blog from the tracker for a specific user.

Description

bp_blogs_remove_blog_for_user( (int) $user_id, (int) $blog_id ); 

Parameters (2)

0. $user_id (int)
ID of the user for whom the blog is being removed.
1. $blog_id (int)
ID of the blog being removed.

Usage

  1. if ( !function_exists( 'bp_blogs_remove_blog_for_user' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-functions.php'; 
  3.  
  4. // ID of the user for whom the blog is being removed. 
  5. $user_id = -1; 
  6.  
  7. // ID of the blog being removed. 
  8. $blog_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_blogs_remove_blog_for_user($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_blog_for_user( $user_id, $blog_id ) { 
  2.  
  3. $blog_id = (int) $blog_id; 
  4. $user_id = (int) $user_id; 
  5.  
  6. /** 
  7. * Fires before a blog is removed from the tracker for a specific user. 
  8. * @since 1.5.0 
  9. * @param int $blog_id ID of the blog being removed. 
  10. * @param int $user_id ID of the user having the blog removed for. 
  11. */ 
  12.  
  13. BP_Blogs_Blog::delete_blog_for_user( $blog_id, $user_id ); 
  14.  
  15. /** 
  16. * Fires after a blog has been removed from the tracker for a specific user. 
  17. * @since 1.0.0 
  18. * @param int $blog_id ID of the blog that was removed. 
  19. * @param int $user_id ID of the user having the blog removed for. 
  20. */ 
  21. do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id );