From f3faa6c75dd8e6cd246552863b1d0d32003bab9c Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 14 Feb 2006 00:12:09 +0000 Subject: [PATCH] Fix timestamps for future posts. fixes #2439 git-svn-id: http://svn.automattic.com/wordpress/trunk@3525 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions-post.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index af5a8db0af..c3f9bd11de 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -72,8 +72,11 @@ function wp_insert_post($postarr = array()) { $post_date_gmt = get_gmt_from_date($post_date); } - if ( 'publish' == $post_status && (mysql2date('U', $post_date_gmt) > time()) ) - $post_status = 'future'; + if ( 'publish' == $post_status ) { + $now = gmdate('Y-m-d H:i:59'); + if ( mysql2date('U', $post_date_gmt) > mysql2date('U', $now) ) + $post_status = 'future'; + } if ( empty($comment_status) ) { if ( $update ) @@ -208,7 +211,7 @@ function wp_insert_post($postarr = array()) { } if ( 'future' == $post_status ) - wp_schedule_event(mysql2date('U', $post_date_gmt), 'once', 'publish_future_post', $post_ID); + wp_schedule_event(mysql2date('U', $post_date), 'once', 'publish_future_post', $post_ID); do_action('save_post', $post_ID); do_action('wp_insert_post', $post_ID);