bp_blogs_delete_new_blog_activity_for_site

Deletes the 'new_blog' activity entry when a site is deleted.

Description

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

Parameters (2)

0. $blog_id (int)
The blog id.
1. $user_id — Optional. (int)
The user id.

Usage

  1. if ( !function_exists( 'bp_blogs_delete_new_blog_activity_for_site' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-activity.php'; 
  3.  
  4. // The blog id. 
  5. $blog_id = -1; 
  6.  
  7. // The user id. 
  8. $user_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_blogs_delete_new_blog_activity_for_site($blog_id, $user_id); 
  12.  

Defined (1)

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

/bp-blogs/bp-blogs-activity.php  
  1. function bp_blogs_delete_new_blog_activity_for_site( $blog_id, $user_id = 0 ) { 
  2. $args = array( 
  3. 'item_id' => $blog_id,  
  4. 'component' =>buddypress)->blogs->id,  
  5. 'type' => 'new_blog' 
  6. ); 
  7.  
  8. /** 
  9. * In the case a user is removed, make sure he is the author of the 'new_blog' activity 
  10. * when trying to delete it. 
  11. */ 
  12. if ( ! empty( $user_id ) ) { 
  13. $args['user_id'] = $user_id; 
  14.