Changeset 7577
- Timestamp:
- 11/15/2013 09:31:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-functions.php
r7555 r7577 248 248 249 249 /** 250 * Detect a change in post status, and initiate an activity update if necessary. 251 * 252 * Posts get new activity updates when (a) they are being published, and (b) 253 * they have not already been published. This enables proper posting for 254 * regular posts as well as scheduled posts, while preventing post bumping. 255 * 256 * See #4090, #3746, #2546 for background. 257 * 258 * @since BuddyPress (1.9.0) 259 * 260 * @param string $new_status New status for the post. 261 * @param string $old_status Old status for the post. 262 * @param object $post Post data. 263 */ 264 function bp_blogs_catch_published_post( $new_status, $old_status, $post ) { 265 266 // Only record published posts 267 if ( 'publish' !== $new_status ) { 268 return; 269 } 270 271 // Don't record edits (publish -> publish) 272 if ( 'publish' === $old_status ) { 273 return; 274 } 275 276 return bp_blogs_record_post( $post->ID, $post ); 277 } 278 add_action( 'transition_post_status', 'bp_blogs_catch_published_post', 10, 3 ); 279 280 /** 250 281 * Record a new blog post in the BuddyPress activity stream. 251 282 * … … 327 358 'item_id' => $blog_id, 328 359 'secondary_item_id' => $post_id, 329 'recorded_time' => $post->post_ modified_gmt360 'recorded_time' => $post->post_date_gmt, 330 361 )); 331 362 } … … 339 370 do_action( 'bp_blogs_new_blog_post', $post_id, $post, $user_id ); 340 371 } 341 add_action( 'save_post', 'bp_blogs_record_post', 10, 2 );342 372 343 373 /**
Note: See TracChangeset
for help on using the changeset viewer.