From 92e3e6d69fd067f7091f492164d7534bc1733778 Mon Sep 17 00:00:00 2001 From: Dion Hulse 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: https://develop.svn.wordpress.org/trunk@14062 602fd350-edb4-49c9-b593-d223f7449a82 --- 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) ) {