Changeset 15191
- Timestamp:
- 06/10/2010 05:37:15 PM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/nav-menu.php
r15116 r15191 366 366 function wp_nav_menu_setup() { 367 367 // Register meta boxes 368 if ( get_registered_nav_menus() && wp_get_nav_menus() )368 if ( ( current_theme_supports( 'widgets' ) || get_registered_nav_menus() ) && wp_get_nav_menus() ) 369 369 add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' ); 370 370 add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); … … 462 462 global $nav_menu_selected_id; 463 463 $locations = get_registered_nav_menus(); 464 465 if ( empty( $locations ) ) { 466 // We must only support widgets. Leave a message and bail. 467 echo '<p class="howto">' . __('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.') . '</p>'; 468 return; 469 } 470 464 471 $menus = wp_get_nav_menus(); 465 472 $menu_locations = get_nav_menu_locations(); -
trunk/wp-admin/nav-menus.php
r15189 r15191 249 249 // Remove this menu from any locations. 250 250 $locations = get_theme_mod( 'nav_menu_locations' ); 251 foreach ( $locations as $location => $menu_id ) {251 foreach ( (array) $locations as $location => $menu_id ) { 252 252 if ( $menu_id == $nav_menu_selected_id ) 253 253 $locations[ $location ] = 0; … … 431 431 } 432 432 433 // The theme supports menus 434 if ( current_theme_supports('nav-menus') ) { 435 // Set up nav menu 436 wp_nav_menu_setup(); 437 438 // The theme does not support menus but supports widgets 439 } elseif ( current_theme_supports('widgets') ) { 440 // Set up nav menu 441 wp_nav_menu_setup(); 442 $messages[] = '<div id="message" class="error"><p>' . __('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.') . '</p></div>'; 443 } 444 433 wp_nav_menu_setup(); 445 434 wp_initial_nav_menu_meta_boxes(); 435 436 if ( ! get_registered_nav_menus() && ! wp_get_nav_menus() ) 437 echo '<div id="message" class="updated"><p>' . __('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.') . '</p></div>'; 446 438 447 439 $help = '<p>' . __('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.') . '</p>';
Note: See TracChangeset
for help on using the changeset viewer.