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
This commit is contained in:
ryan 2006-08-07 04:43:38 +00:00
parent 7bf42ee218
commit 403a5db6c5
1 changed files with 5 additions and 3 deletions

View File

@ -688,10 +688,12 @@ function wp_insert_post($postarr = array()) {
do_action('publish_page', $post_ID);
}
if ( 'future' == $post_status ) {
// 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);