From cc3d87bf2bca3e4399fac74d902cde83eace4f77 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 5 May 2009 05:53:55 +0000 Subject: [PATCH] Always do post status transition actions. Props nbachiyski. fixes #8792 git-svn-id: http://svn.automattic.com/wordpress/trunk@11197 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 8482405958..ff57eaea00 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1817,15 +1817,15 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) { /** * Transition the post status of a post. * - * Calls hooks to transition post status. If the new post status is not the same - * as the previous post status, then two hooks will be ran, the first is - * 'transition_post_status' with new status, old status, and post data. The - * next action called is 'OLDSTATUS_to_NEWSTATUS' the NEWSTATUS is the + * Calls hooks to transition post status. + * + * The first is 'transition_post_status' with new status, old status, and post data. + * + * The next action called is 'OLDSTATUS_to_NEWSTATUS' the NEWSTATUS is the * $new_status parameter and the OLDSTATUS is $old_status parameter; it has the * post data. * - * The final action will run whether or not the post statuses are the same. The - * action is named 'NEWSTATUS_POSTTYPE', NEWSTATUS is from the $new_status + * The final action is named 'NEWSTATUS_POSTTYPE', NEWSTATUS is from the $new_status * parameter and POSTTYPE is post_type post data. * * @since 2.3.0 @@ -1835,10 +1835,8 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) { * @param object $post Post data. */ function wp_transition_post_status($new_status, $old_status, $post) { - if ( $new_status != $old_status ) { - do_action('transition_post_status', $new_status, $old_status, $post); - do_action("${old_status}_to_$new_status", $post); - } + do_action('transition_post_status', $new_status, $old_status, $post); + do_action("${old_status}_to_$new_status", $post); do_action("${new_status}_$post->post_type", $post->ID, $post); }