Changeset 6792
- Timestamp:
- 03/29/2018 07:14:02 PM (7 years ago)
- Location:
- trunk/src/includes/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/actions.php
r6780 r6792 54 54 add_action( 'wp_head', 'bbp_head', 10 ); 55 55 add_action( 'wp_footer', 'bbp_footer', 10 ); 56 add_action( 'transition_post_status', 'bbp_transition_post_status', 10, 3 ); 56 57 57 58 /** -
trunk/src/includes/core/sub-actions.php
r6757 r6792 255 255 function bbp_login_form_login() { 256 256 do_action( 'bbp_login_form_login' ); 257 } 258 259 260 /** 261 * Add the bbPress-specific post status transition action 262 * 263 * @since 2.6.0 bbPress (r6792) 264 * 265 * @param string $new_status New post status 266 * @param string $old_status Old post status 267 * @param WP_Post $post Post object 268 */ 269 function bbp_transition_post_status( $new_status = '', $old_status = '', $post = false ) { 270 271 // Get bbPress post types 272 $post_type = get_post_type( $post ); 273 $types = get_post_types( array( 'source' => 'bbpress' ) ); 274 275 // Bail if post is not a bbPress post type 276 if ( ! in_array( $post_type, $types, true ) ) { 277 return; 278 } 279 280 // Do the action 281 do_action( 'bbp_transition_post_status', $new_status, $old_status, $post ); 257 282 } 258 283
Note: See TracChangeset
for help on using the changeset viewer.