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
This commit is contained in:
dd32 2010-04-10 14:00:30 +00:00
parent 9342a4b4c8
commit 0e7c1a0cb3
1 changed files with 4 additions and 0 deletions

View File

@ -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) ) {