diff --git a/wp-includes/post.php b/wp-includes/post.php index d0bb246f0..45af008b6 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);