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

git-svn-id: http://svn.automattic.com/wordpress/trunk@14621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-14 06:35:57 +00:00
parent a743de0788
commit c5d2cdc52d
1 changed files with 2 additions and 1 deletions

View File

@ -308,7 +308,8 @@ function _wp_ajax_menu_quick_search( $request = array() ) {
**/
function wp_nav_menu_setup() {
// Register meta boxes
add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );
if ( get_registered_nav_menus() && wp_get_nav_menus() )
add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );
add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
wp_nav_menu_post_type_meta_boxes();
wp_nav_menu_taxonomy_meta_boxes();