diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index a45b993e3..2edb3dca1 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -365,7 +365,7 @@ function _wp_ajax_menu_quick_search( $request = array() ) { **/ function wp_nav_menu_setup() { // Register meta boxes - if ( ( current_theme_supports( 'widgets' ) || get_registered_nav_menus() ) && wp_get_nav_menus() ) + if ( 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(); @@ -460,14 +460,14 @@ function wp_nav_menu_taxonomy_meta_boxes() { */ function wp_nav_menu_locations_meta_box() { global $nav_menu_selected_id; - $locations = get_registered_nav_menus(); - if ( empty( $locations ) ) { + if ( ! current_theme_supports( 'menus' ) ) { // We must only support widgets. Leave a message and bail. echo '

' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '

'; return; } + $locations = get_registered_nav_menus(); $menus = wp_get_nav_menus(); $menu_locations = get_nav_menu_locations(); $num_locations = count( array_keys($locations) ); diff --git a/wp-admin/menu.php b/wp-admin/menu.php index daeb1fb3d..7d447c63e 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -157,12 +157,12 @@ $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' ); if ( current_user_can( 'switch_themes') ) { $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); - if ( current_theme_supports( 'nav-menus' ) || current_theme_supports( 'widgets' ) ) + if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php'); } else { $menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); $submenu['themes.php'][5] = array(__('Themes'), 'edit_theme_options', 'themes.php'); - if ( current_theme_supports( 'nav-menus' ) || current_theme_supports( 'widgets' ) ) + if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' ); } diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index c56b84ac3..798ec79b2 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -15,7 +15,7 @@ require_once( 'admin.php' ); // Load all the nav menu interface functions require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' ); -if ( ! current_theme_supports( 'nav-menus' ) && ! current_theme_supports( 'widgets' ) ) +if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' ) ) wp_die( __( 'Your theme does not support navigation menus or widgets.' ) ); // Permissions Check @@ -433,7 +433,7 @@ foreach( (array) $nav_menus as $key => $_nav_menu ) { wp_nav_menu_setup(); wp_initial_nav_menu_meta_boxes(); -if ( ! get_registered_nav_menus() && ! wp_get_nav_menus() ) +if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() ) echo '

' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '

'; $help = '

' . __('This feature is new in version 3.0; to use a custom menu in place of your theme’s default menus, support for this feature must be registered in the theme’s functions.php file. If your theme does not support the custom menus feature yet (the new default theme, Twenty Ten, does), you can learn about adding support yourself by following the below link.') . '

'; diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index 3cfbb62ca..cc45a2472 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -61,7 +61,8 @@ if ( ! function_exists( 'twentyten_setup' ) ): * To override twentyten_setup() in a child theme, add your own twentyten_setup to your child theme's * functions.php file. * - * @uses add_theme_support() To add support for post thumbnails, navigation menus, and automatic feed links. + * @uses add_theme_support() To add support for post thumbnails and automatic feed links. + * @uses register_nav_menus() To add support for navigation menus. * @uses add_custom_background() To add support for a custom background. * @uses add_editor_style() To style the visual editor. * @uses load_theme_textdomain() For translation/localization support. diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index 4607ec5ee..dd683f636 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -73,7 +73,7 @@ function is_nav_menu( $menu ) { function register_nav_menus( $locations = array() ) { global $_wp_registered_nav_menus; - add_theme_support( 'nav-menus' ); + add_theme_support( 'menus' ); $_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations ); }