diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-02-16 12:55:46 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-02-16 12:55:46 +0000 |
| commit | 2ab4faee68383698b06cc23eef6ce8f41612f58d (patch) | |
| tree | 5324a28a65ef148d30befb8d3ab38290d0118e8a /wp-inst/wp-admin/upgrade-functions.php | |
| parent | 3274315bf43466070cd481ee2d08cf8114d3c8f7 (diff) | |
WP updates
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@528 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/upgrade-functions.php')
| -rw-r--r-- | wp-inst/wp-admin/upgrade-functions.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/wp-inst/wp-admin/upgrade-functions.php b/wp-inst/wp-admin/upgrade-functions.php index 80314c0..b1c2046 100644 --- a/wp-inst/wp-admin/upgrade-functions.php +++ b/wp-inst/wp-admin/upgrade-functions.php @@ -34,7 +34,7 @@ function upgrade_all() { if ( $wp_current_db_version < 3308 ) upgrade_160(); - if ( $wp_current_db_version < 3514 ) + if ( $wp_current_db_version < 3533 ) upgrade_210(); $wp_rewrite->flush_rules(); @@ -367,6 +367,17 @@ function upgrade_210() { if ( $wp_current_db_version < 3513 ) { populate_roles_210(); } + + if ( $wp_current_db_version < 3533 ) { + // Give future posts a post_status of future. + $now = gmdate('Y-m-d H:i:59'); + $wpdb->query ("UPDATE $wpdb->posts SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '$now'"); + + $posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'"); + if ( !empty($posts) ) + foreach ( $posts as $post ) + wp_schedule_event(mysql2date('U', $post->post_date), 'once', 'publish_future_post', $post->ID); + } } // The functions we use to actually do stuff |
