Changeset 3510 for trunk/wp-admin/upgrade-functions.php
- Timestamp:
- 02/09/2006 10:03:48 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/upgrade-functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade-functions.php
r3373 r3510 33 33 if ( $wp_current_db_version < 3308 ) 34 34 upgrade_160(); 35 36 if ( $wp_current_db_version < 3506 ) 37 upgrade_210(); 35 38 36 39 $wp_rewrite->flush_rules(); … … 324 327 add_post_meta($object->ID, '_wp_attached_file', $meta['file']); 325 328 } 329 } 330 } 331 332 function upgrade_210() { 333 global $wpdb, $table_prefix, $wp_current_db_version; 334 335 // Update status and type. 336 $posts = $wpdb->get_results("SELECT ID, post_status FROM $wpdb->posts"); 337 338 if ( ! empty($posts) ) foreach ($posts as $post) { 339 $status = $post->post_status; 340 $type = 'post'; 341 342 if ( 'static' == $status ) { 343 $status = 'publish'; 344 $type = 'page'; 345 } else if ( 'attachment' == $status ) { 346 $status = 'inherit'; 347 $type = 'attachment'; 348 } 349 350 $wpdb->query("UPDATE $wpdb->posts SET post_status = '$status', post_type = '$type' WHERE ID = '$post->ID'"); 326 351 } 327 352 }
Note: See TracChangeset
for help on using the changeset viewer.