Make WordPress Core

Changeset 14621


Ignore:
Timestamp:
05/14/2010 06:35:57 AM (14 years ago)
Author:
nacin
Message:

Only show Theme Locations meta box if menus exist and if the theme has registered menus. see #13378.

File:
1 edited

Legend:

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

    r14620 r14621  
    309309function wp_nav_menu_setup() {
    310310    // Register meta boxes
    311     add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );
     311    if ( get_registered_nav_menus() && wp_get_nav_menus() )
     312        add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );
    312313    add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
    313314    wp_nav_menu_post_type_meta_boxes();
Note: See TracChangeset for help on using the changeset viewer.