WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/03/2010 10:52:30 PM (10 years ago)
Author:
nacin
Message:

Don't use target="_self" in nav menu links, just omit the attribute. Also fix and run earlier db upgrades. fixes #12808

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/upgrade.php

    r13956 r13974  
    441441        upgrade_290();
    442442
    443     if ( $wp_current_db_version < 12751 )
     443    if ( $wp_current_db_version < 13974 )
    444444        upgrade_300();
    445445
     
    11151115    }
    11161116
    1117     // 3.0-alpha nav menu postmeta changes. can be removed before release
    1118     if ( $wp_current_db_version >= 13226 && $wp_current_db_version < 13802 ) {
    1119         // remove old nav menu post meta keys
    1120         $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN( 'menu_type', 'object_id', 'menu_new_window', 'menu_link', '_menu_item_append', 'menu_item_append' )" );
    1121         // update nav menu post meta keys to underscore prefixes
    1122         $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_type' ), array( 'meta_key' => 'menu_item_type' ) );
    1123         $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_object_id' ), array( 'meta_key' => 'menu_item_object_id' ) );
    1124         $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_target' ), array( 'meta_key' => 'menu_item_target' ) );
    1125         $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_classes' ), array( 'meta_key' => 'menu_item_classes' ) );
    1126         $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_xfn' ), array( 'meta_key' => 'menu_item_xfn' ) );
    1127         $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_url' ), array( 'meta_key' => 'menu_item_url' ) );
    1128     }
    1129 
    1130     // 3.0-beta1 remove_user primitive->meta cap. can be removed before release
    1131     if ( $wp_current_db_version >= 12751 && $wp_current_db_version < 12751 ) {
     1117    // 3.0-alpha nav menu postmeta changes. can be removed before release. // r13802
     1118    if ( $wp_current_db_version >= 13226 && $wp_current_db_version < 13974 )
     1119        $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN( 'menu_type', 'object_id', 'menu_new_window', 'menu_link', '_menu_item_append', 'menu_item_append', 'menu_item_type', 'menu_item_object_id', 'menu_item_target', 'menu_item_classes', 'menu_item_xfn', 'menu_item_url' )" );
     1120
     1121    // 3.0-beta1 remove_user primitive->meta cap. can be removed before release. r13956
     1122    if ( $wp_current_db_version >= 12751 && $wp_current_db_version < 13974 ) {
    11321123        $role =& get_role( 'administrator' );
    11331124        if ( ! empty( $role ) )
    11341125            $role->remove_cap( 'remove_user' );
    11351126    }
     1127
     1128    // 3.0-beta1 nav menu postmeta changes. can be removed before release. r13974
     1129    if ( $wp_current_db_version >= 13802 && $wp_current_db_version < 13974 )
     1130        $wpdb->update( $wpdb->postmeta, array( 'meta_value' => '' ), array( 'meta_key' => '_menu_item_target', 'meta_value' => '_self' ) );
     1131
    11361132}
    11371133
Note: See TracChangeset for help on using the changeset viewer.