Changeset 25209 for trunk/src/wp-admin/includes/nav-menu.php
- Timestamp:
- 09/02/2013 11:25:16 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/nav-menu.php
r25098 r25209 486 486 487 487 /** 488 * Displays a metabox for the nav menu theme locations.489 *490 * @since 3.0.0491 */492 function wp_nav_menu_locations_meta_box() {493 global $nav_menu_selected_id;494 495 if ( ! current_theme_supports( 'menus' ) ) {496 // We must only support widgets. Leave a message and bail.497 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>';498 return;499 }500 501 $locations = get_registered_nav_menus();502 $menus = wp_get_nav_menus();503 $menu_locations = get_nav_menu_locations();504 $num_locations = count( array_keys($locations) );505 506 echo '<p class="howto">' . _n( 'Select a menu to use within your theme.', 'Select the menus you will use in your theme.', $num_locations ) . '</p>';507 508 foreach ( $locations as $location => $description ) {509 ?>510 <p>511 <label class="howto" for="locations-<?php echo $location; ?>">512 <span><?php echo $description; ?></span>513 <select name="menu-locations[<?php echo $location; ?>]" id="locations-<?php echo $location; ?>">514 <option value="0"></option>515 <?php foreach ( $menus as $menu ) : ?>516 <option<?php selected( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $menu->term_id ); ?>517 value="<?php echo $menu->term_id; ?>"><?php echo wp_html_excerpt( $menu->name, 40, '…' ); ?></option>518 <?php endforeach; ?>519 </select>520 </label>521 </p>522 <?php523 }524 ?>525 <p class="button-controls">526 <?php submit_button( __( 'Save' ), 'primary right', 'nav-menu-locations', false, wp_nav_menu_disabled_check( $nav_menu_selected_id ) ); ?>527 <span class="spinner"></span>528 </p>529 <?php530 }531 532 /**533 488 * Check whether to disable the Menu Locations meta box submit button 534 489 *
Note: See TracChangeset
for help on using the changeset viewer.