bp_blogs_record_post

Record a new blog post in the BuddyPress activity stream.

Description

(bool|null) bp_blogs_record_post( (int) $post_id, (object) $post, (int) $user_id = 0 ); 

Returns (bool|null)

Returns false on failure.

Parameters (3)

0. $post_id (int)
ID of the post being recorded.
1. $post (object)
The WP post object passed to the save_post action.
2. $user_id — Optional. (int)
The user to whom the activity item will be associated. Defaults to the post_author.

Usage

  1. if ( !function_exists( 'bp_blogs_record_post' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/deprecated/2.2.php'; 
  3.  
  4. // ID of the post being recorded. 
  5. $post_id = -1; 
  6.  
  7. // The WP post object passed to the 'save_post' action. 
  8. $post = null; 
  9.  
  10. // Optional. The user to whom the activity item will be 
  11. // associated. Defaults to the post_author. 
  12. $user_id = -1; 
  13.  
  14. // NOTICE! Understand what this does before running. 
  15. $result = bp_blogs_record_post($post_id, $post, $user_id); 
  16.  

Defined (1)

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

/bp-core/deprecated/2.2.php  
  1. function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) { 
  2. _deprecated_function( __FUNCTION__, '2.2', 'bp_activity_post_type_publish()' ); 
  3. bp_activity_post_type_publish( $post_id, $post, $user_id );