bp_activity_pre_transition_post_type_comment_status

Leave a chance to plugins to manage activity comments differently.

Description

apply_filters( 'bp_activity_pre_transition_post_type_comment_status', (bool) $false, (string) $post_type, (int) $activity_id, (string) $new_status, (string) $old_status, (WP_Comment) $comment ); 

Parameters (6)

0. $false (bool) => false
True to override BuddyPress management.
1. $post_type (string)
The post type name.
2. $activity_id (int)
The post type activity (0 if not found).
3. $new_status (string)
The new status of the post type comment.
4. $old_status (string)
The old status of the post type comment.
5. $comment (WP_Comment)
Comment data.

Usage

To run the hook, copy the example below.
  1. $false = apply_filters( 'bp_activity_pre_transition_post_type_comment_status', $false, $post_type, $activity_id, $new_status, $old_status, $comment ); 
  2.  
  3. if ( !empty( $false ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_activity_pre_transition_post_type_comment_status callback 
  2. function filter_bp_activity_pre_transition_post_type_comment_status( $false, $post_type, $activity_id, $new_status, $old_status, $comment ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_activity_pre_transition_post_type_comment_status', 'filter_bp_activity_pre_transition_post_type_comment_status', 10, 6 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_activity_pre_transition_post_type_comment_status', 'filter_bp_activity_pre_transition_post_type_comment_status', 10, 6 ); 

Defined (1)

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

/bp-activity/bp-activity-actions.php  
  1. if ( true === apply_filters( 'bp_activity_pre_transition_post_type_comment_status', false, $post_type, $activity_id, $new_status, $old_status, $comment ) ) {