bp_blogs_record_comment

Record a new blog comment in the BuddyPress activity stream.

Description

(bool|object) bp_blogs_record_comment( (int) $comment_id, (bool) $is_approved = true ); 

Only posts the item if blog is public and post is not password-protected.

Returns (bool|object)

Returns false on failure, the comment object on success.

Parameters (2)

0. $comment_id (int)
ID of the comment being recorded.
1. $is_approved — Optional. (bool) => true
The $is_approved value passed to the comment_post action. Default: true.

Usage

  1. if ( !function_exists( 'bp_blogs_record_comment' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/deprecated/2.5.php'; 
  3.  
  4. // ID of the comment being recorded. 
  5. $comment_id = -1; 
  6.  
  7. // Optional. The $is_approved value passed to 
  8. // the 'comment_post' action. Default: true. 
  9. $is_approved = true; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = bp_blogs_record_comment($comment_id, $is_approved); 
  13.  

Defined (1)

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

/bp-core/deprecated/2.5.php  
  1. function bp_blogs_record_comment( $comment_id, $is_approved = true ) { 
  2. _deprecated_function( __FUNCTION__, '2.5.0', 'bp_activity_post_type_comment()' ); 
  3. bp_activity_post_type_comment( $comment_id, $is_approved );