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
This commit is contained in:
parent
9f21f365bb
commit
92e3e6d69f
@ -2155,6 +2155,10 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
|
|||||||
$now = gmdate('Y-m-d H:i:59');
|
$now = gmdate('Y-m-d H:i:59');
|
||||||
if ( mysql2date('U', $post_date_gmt, false) > mysql2date('U', $now, false) )
|
if ( mysql2date('U', $post_date_gmt, false) > mysql2date('U', $now, false) )
|
||||||
$post_status = 'future';
|
$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) ) {
|
if ( empty($comment_status) ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user