bp_blogs_catch_transition_post_status

Detect a change in post status, and initiate an activity update if necessary.

Description

bp_blogs_catch_transition_post_status( (string) $new_status, (string) $old_status, (object) $post ); 

Posts get new activity updates when (a) they are being published, and (b) they have not already been published. This enables proper posting for regular posts as well as scheduled posts, while preventing post bumping.

See #4090, #3746, #2546 for background.

Parameters (3)

0. $new_status (string)
New status for the post.
1. $old_status (string)
Old status for the post.
2. $post (object)
Post data.

Usage

  1. if ( !function_exists( 'bp_blogs_catch_transition_post_status' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/deprecated/2.2.php'; 
  3.  
  4. // New status for the post. 
  5. $new_status = ''; 
  6.  
  7. // Old status for the post. 
  8. $old_status = ''; 
  9.  
  10. // Post data. 
  11. $post = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bp_blogs_catch_transition_post_status($new_status, $old_status, $post); 
  15.  

Defined (1)

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

/bp-core/deprecated/2.2.php  
  1. function bp_blogs_catch_transition_post_status( $new_status, $old_status, $post ) { 
  2. _deprecated_function( __FUNCTION__, '2.2', 'bp_activity_catch_transition_post_type_status()' ); 
  3. bp_activity_catch_transition_post_type_status( $new_status, $old_status, $post );