From 0e7c1a0cb398e923893944d7ccd1063827ebbffb Mon Sep 17 00:00:00 2001 From: dd32 Date: Sat, 10 Apr 2010 14:00:30 +0000 Subject: [PATCH] Update Future Scheduled posts publish status to Published upon updating the date to a past date. Props bumbu. Fixes #12751 git-svn-id: http://svn.automattic.com/wordpress/trunk@14062 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index 33f149a9af..949d990dd7 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2155,6 +2155,10 @@ function wp_insert_post($postarr = array(), $wp_error = false) { $now = gmdate('Y-m-d H:i:59'); if ( mysql2date('U', $post_date_gmt, false) > mysql2date('U', $now, false) ) $post_status = 'future'; + } elseif( 'future' == $post_status ) { + $now = gmdate('Y-m-d H:i:59'); + if ( mysql2date('U', $post_date_gmt, false) <= mysql2date('U', $now, false) ) + $post_status = 'publish'; } if ( empty($comment_status) ) {