| | 1259 | * Execute changes made in WordPress 3.8.2. |
| | 1260 | * |
| | 1261 | * @since 3.8.2 |
| | 1262 | */ |
| | 1263 | function upgrade_382() { |
| | 1264 | global $wp_current_db_version, $wpdb; |
| | 1265 | if ( $wp_current_db_version < 30000 ) { |
| | 1266 | // Find all lost Quick Draft auto-drafts and promote them to proper drafts. |
| | 1267 | // Auto Drafts never have content as that would mean they should have been promoted. |
| | 1268 | // Bring them back in place, with no date changes or other processing. |
| | 1269 | $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type = 'post' |
| | 1270 | AND post_status = 'auto-draft' AND post_date >= '2014-04-08 00:00:00' AND post_content <> ''" ); |
| | 1271 | foreach ( $post_ids as $post_id ) { |
| | 1272 | $wpdb->update( $wpdb->posts, array( 'post_status' => 'draft' ), array( 'ID' => $post_id ) ); |
| | 1273 | clean_post_cache( $post_id ); |
| | 1274 | } |
| | 1275 | } |
| | 1276 | } |
| | 1277 | |
| | 1278 | /** |