Remove old edit_*_per_page usermeta keys.

These per-page values were when the post type or taxonomy name has a hyphen.
Previously, these were converted to underscores. This changed in [21322].

fixes #18958.



git-svn-id: https://develop.svn.wordpress.org/trunk@21811 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-09-11 02:08:29 +00:00
parent 5097915ce8
commit 56c0d2932c
2 changed files with 15 additions and 2 deletions

View File

@ -399,7 +399,7 @@ function upgrade_all() {
if ( $wp_current_db_version < 20080 )
upgrade_340();
if ( $wp_current_db_version < 21501 )
if ( $wp_current_db_version < 21811 )
upgrade_350();
maybe_disable_link_manager();
@ -1195,6 +1195,19 @@ function upgrade_350() {
if ( $wp_current_db_version < 21501 && $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) )
update_option( 'link_manager_enabled', 1 ); // Previously set to 0 by populate_options()
if ( $wp_current_db_version < 21811 && is_main_site() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
$meta_keys = array();
foreach ( array_merge( get_post_types(), get_taxonomies() ) as $name ) {
if ( false !== strpos( $name, '-' ) )
$meta_keys[] = 'edit_' . str_replace( '-', '_', $name ) . '_per_page';
}
if ( $meta_keys ) {
$meta_keys = implode( "', '", $meta_keys );
$wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key IN ('$meta_keys')" );
}
}
}
/**

View File

@ -11,7 +11,7 @@ $wp_version = '3.5-alpha-21751';
*
* @global int $wp_db_version
*/
$wp_db_version = 21804;
$wp_db_version = 21811;
/**
* Holds the TinyMCE version