mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 07:37:44 +02:00
Fix timestamps for future posts. fixes #2439
git-svn-id: http://svn.automattic.com/wordpress/trunk@3525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d0f14a4c93
commit
f3faa6c75d
@ -72,8 +72,11 @@ function wp_insert_post($postarr = array()) {
|
|||||||
$post_date_gmt = get_gmt_from_date($post_date);
|
$post_date_gmt = get_gmt_from_date($post_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 'publish' == $post_status && (mysql2date('U', $post_date_gmt) > time()) )
|
if ( 'publish' == $post_status ) {
|
||||||
$post_status = 'future';
|
$now = gmdate('Y-m-d H:i:59');
|
||||||
|
if ( mysql2date('U', $post_date_gmt) > mysql2date('U', $now) )
|
||||||
|
$post_status = 'future';
|
||||||
|
}
|
||||||
|
|
||||||
if ( empty($comment_status) ) {
|
if ( empty($comment_status) ) {
|
||||||
if ( $update )
|
if ( $update )
|
||||||
@ -208,7 +211,7 @@ function wp_insert_post($postarr = array()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( 'future' == $post_status )
|
if ( 'future' == $post_status )
|
||||||
wp_schedule_event(mysql2date('U', $post_date_gmt), 'once', 'publish_future_post', $post_ID);
|
wp_schedule_event(mysql2date('U', $post_date), 'once', 'publish_future_post', $post_ID);
|
||||||
|
|
||||||
do_action('save_post', $post_ID);
|
do_action('save_post', $post_ID);
|
||||||
do_action('wp_insert_post', $post_ID);
|
do_action('wp_insert_post', $post_ID);
|
||||||
|
Loading…
Reference in New Issue
Block a user