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:
parent
9342a4b4c8
commit
0e7c1a0cb3
|
@ -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) ) {
|
||||
|
|
Loading…
Reference in New Issue