Make WordPress Core


Ignore:
Timestamp:
06/10/2010 05:57:30 PM (14 years ago)
Author:
nacin
Message:

Switch to current_theme_supports(menus) internally. Adding theme support for 'nav-menus' is deprecated in favor of register_nav_menu(s). fixes #13825.

File:
1 edited

Legend:

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

    r15191 r15193  
    366366function wp_nav_menu_setup() {
    367367    // Register meta boxes
    368     if ( ( current_theme_supports( 'widgets' ) || get_registered_nav_menus() ) && wp_get_nav_menus() )
     368    if ( wp_get_nav_menus() )
    369369        add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );
    370370    add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
     
    461461function wp_nav_menu_locations_meta_box() {
    462462    global $nav_menu_selected_id;
    463     $locations = get_registered_nav_menus();
    464 
    465     if ( empty( $locations ) ) {
     463
     464    if ( ! current_theme_supports( 'menus' ) ) {
    466465        // We must only support widgets. Leave a message and bail.
    467466        echo '<p class="howto">' . __('The current theme does not natively support menus, but you can use the &#8220;Custom Menu&#8221; widget to add any menus you create here to the theme&#8217;s sidebar.') . '</p>';
     
    469468    }
    470469
     470    $locations = get_registered_nav_menus();
    471471    $menus = wp_get_nav_menus();
    472472    $menu_locations = get_nav_menu_locations();
Note: See TracChangeset for help on using the changeset viewer.