Ticket #9539: 9539.2.diff
| File 9539.2.diff, 1.8 KB (added by , 17 years ago) |
|---|
-
wp-includes/version.php
15 15 * 16 16 * @global int $wp_db_version 17 17 */ 18 $wp_db_version = 1 0850;18 $wp_db_version = 11200; 19 19 20 20 ?> -
wp-admin/includes/upgrade.php
340 340 if ( $wp_current_db_version < 8989 ) 341 341 upgrade_270(); 342 342 343 if ( $wp_current_db_version < 1 0360 )343 if ( $wp_current_db_version < 11200 ) 344 344 upgrade_280(); 345 345 346 346 maybe_disable_automattic_widgets(); … … 980 980 981 981 if ( $wp_current_db_version < 10360 ) 982 982 populate_roles_280(); 983 984 if ( $wp_current_db_version < 11200 ) 985 fix_attachment_slug_conflicts(); 983 986 } 984 987 985 988 -
wp-admin/includes/schema.php
576 576 } 577 577 } 578 578 579 ?> 579 /** 580 * Fix duplicate slugs in hierarchical data 581 * See http://core.trac.wordpress.org/ticket/9539 582 * 583 * @since 2.8.0 584 **/ 585 586 function fix_attachment_slug_conflicts() { 587 global $wpdb; 588 589 $attachments = $wpdb->get_results(" 590 SELECT attachment.* 591 FROM $wpdb->posts as attachment 592 JOIN $wpdb->posts as page 593 ON attachment.post_name = page.post_name 594 WHERE attachment.post_type = 'attachment' 595 AND page.post_type = 'page' 596 AND attachment.post_parent = page.post_parent 597 AND attachment.post_name <> '' 598 "); 599 600 while ( $attachment = array_pop($attachments) ) 601 wp_update_post($attachment); 602 } # fix_attachment_slug_conflicts() 603 ?> 604 No newline at end of file