Changeset 13810
- Timestamp:
- 03/24/2010 06:35:31 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/nav-menus.php
r13802 r13810 75 75 // Add Menu 76 76 if ( isset($_POST['create-menu-button']) ) { 77 if ( current_theme_supports('nav-menus') ) {77 if ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) { 78 78 $add_nav_menu = esc_html( $_POST['create-menu-name'] ); 79 79 … … 215 215 if ( !is_nav_menu( $nav_menu_selected_id ) ) { 216 216 $messages_div = '<div id="message" class="updated"><p>' . __('You do not have any menus. Create a new menu.') . '</p></div>'; 217 217 218 218 // The theme supports menus 219 219 } elseif ( current_theme_supports('nav-menus') ) { 220 221 220 // Register nav menu metaboxes 222 221 add_meta_box( 'manage-menu', __( 'Menu Settings' ), 'wp_nav_menu_manage_menu_metabox', 'nav-menus', 'side', 'high', array( $nav_menu_selected_id, $nav_menu_selected_title ) ); 223 222 wp_nav_menu_metaboxes_setup(); 224 223 225 // The theme does not support menus 224 // The theme does not support menus but supports widgets 225 } elseif ( current_theme_supports('widgets') ) { 226 // Register nav menu metaboxes 227 add_meta_box( 'manage-menu', __( 'Menu Settings' ), 'wp_nav_menu_manage_menu_metabox', 'nav-menus', 'side', 'high', array( $nav_menu_selected_id, $nav_menu_selected_title ) ); 228 wp_nav_menu_metaboxes_setup(); 229 $messages_div = '<div id="message" class="error"><p>' . __('The current theme does not natively support menus, but you can use the “Navigation Menu” widget to add any menus you create here to the theme’s sidebar.') . '</p></div>'; 230 231 // The theme supports neither menus nor widgets. 226 232 } else { 227 233 remove_meta_box( 'create-menu', 'nav-menus', 'side' ); … … 238 244 <div class="hide-if-js error"><p><?php _e('You do not have JavaScript enabled in your browser. Please enable it to access the Menus functionality.'); ?></p></div> 239 245 240 <?php if ( !empty($nav_menus) && count($nav_menus) > 1 && current_theme_supports('nav-menus') ) : ?>246 <?php if ( !empty($nav_menus) && count($nav_menus) > 1 && ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) ) : ?> 241 247 <ul class="subsubsub"> 242 248 <?php … … 264 270 <div id="post-body"> 265 271 <div id="post-body-content"> 266 <?php if ( is_nav_menu($nav_menu_selected_id) && current_theme_supports('nav-menus') ) : ?>272 <?php if ( is_nav_menu($nav_menu_selected_id) && ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) ) : ?> 267 273 <div id="menu-container" class="postbox"> 268 274 <h3 class="hndle"><?php echo esc_html( $nav_menu_selected_title ); ?></h3> -
trunk/wp-includes/widgets.php
r13770 r13810 563 563 $wp_registered_sidebars[$sidebar['id']] = $sidebar; 564 564 565 add_theme_support('widgets'); 566 565 567 return $sidebar['id']; 566 568 }
Note: See TracChangeset
for help on using the changeset viewer.