bp_blogs_record_activity_on_site_creation

Add an activity entry for a newly-created site.

Description

bp_blogs_record_activity_on_site_creation( (BP_Blogs_Blog) $recorded_blog, (bool) $is_private, (bool) $is_recorded, $no_activity ); 

Hooked to the bp_blogs_new_blog action.

Parameters (4)

0. $recorded_blog (BP_Blogs_Blog)
Current site being recorded. Passed by reference.
1. $is_private (bool)
Whether the current site being recorded is private.
2. $is_recorded (bool)
Whether the current site was recorded.
3. $no_activity
The no activity.

Usage

  1. if ( !function_exists( 'bp_blogs_record_activity_on_site_creation' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-activity.php'; 
  3.  
  4. // Current site being recorded. Passed by reference. 
  5. $recorded_blog = null; 
  6.  
  7. // Whether the current site being recorded is private. 
  8. $is_private = true; 
  9.  
  10. // Whether the current site was recorded. 
  11. $is_recorded = true; 
  12.  
  13. // The no activity. 
  14. $no_activity = null; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bp_blogs_record_activity_on_site_creation($recorded_blog, $is_private, $is_recorded, $no_activity); 
  18.  

Defined (1)

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

/bp-blogs/bp-blogs-activity.php  
  1. function bp_blogs_record_activity_on_site_creation( $recorded_blog, $is_private, $is_recorded, $no_activity ) { 
  2. // Only record this activity if the blog is public. 
  3. if ( ! $is_private && ! $no_activity && bp_blogs_is_blog_trackable( $recorded_blog->blog_id, $recorded_blog->user_id ) ) { 
  4. 'user_id' => $recorded_blog->user_id,  
  5.  
  6. /** 
  7. * Filters the activity created blog primary link. 
  8. * @since 1.1.0 
  9. * @param string $value Blog primary link. 
  10. * @param int $value Blog ID. 
  11. */ 
  12. 'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', bp_blogs_get_blogmeta( $recorded_blog->blog_id, 'url' ), $recorded_blog->blog_id ),  
  13. 'type' => 'new_blog',  
  14. 'item_id' => $recorded_blog->blog_id 
  15. ) );