From 403a5db6c52c8a61234aa8f046aa86ae3ba166ca Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 7 Aug 2006 04:43:38 +0000 Subject: [PATCH] Always clears future publication hook in case the post status bounced from future to draft. git-svn-id: http://svn.automattic.com/wordpress/trunk@4078 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index d0bb246f0a..45af008b63 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -688,10 +688,12 @@ function wp_insert_post($postarr = array()) { do_action('publish_page', $post_ID); } - if ( 'future' == $post_status ) { - wp_clear_scheduled_hook('publish_future_post', $post_ID); + // Always clears the hook in case the post status bounced from future to draft. + wp_clear_scheduled_hook('publish_future_post', $post_ID); + + // Schedule publication. + if ( 'future' == $post_status ) wp_schedule_single_event(mysql2date('U', $post_date), 'publish_future_post', $post_ID); - } do_action('save_post', $post_ID); do_action('wp_insert_post', $post_ID);