Changeset 14620 for trunk/wp-admin/includes/nav-menu.php
- Timestamp:
- 05/14/2010 06:20:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/nav-menu.php
r14614 r14620 309 309 function wp_nav_menu_setup() { 310 310 // Register meta boxes 311 add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' ); 311 312 add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); 312 313 wp_nav_menu_post_type_meta_boxes(); … … 338 339 return; 339 340 340 $initial_meta_boxes = array( ' manage-menu', 'create-menu', 'add-custom-links', 'add-page', 'add-category' );341 $initial_meta_boxes = array( 'nav-menu-theme-locations', 'add-custom-links', 'add-page', 'add-category' ); 341 342 $hidden_meta_boxes = array(); 342 343 … … 395 396 } 396 397 } 398 } 399 400 /** 401 * Displays a metabox for the nav menu theme locations. 402 * 403 * @since 3.0.0 404 */ 405 function wp_nav_menu_locations_meta_box() { 406 $locations = get_registered_nav_menus(); 407 $mods = get_nav_menu_locations(); 408 $menus = wp_get_nav_menus(); 409 $menu_locations = get_nav_menu_locations(); 410 //var_dump( $menus ); 411 foreach ( $locations as $location => $description ) { 412 ?> 413 <p> 414 <label class="howto" for="locations-<?php echo $location; ?>"> 415 <span><?php echo $description; ?></span> 416 <select name="menu-locations[<?php echo $location; ?>]" id="locations-<?php echo $location; ?>"> 417 <option value=""></option> 418 <?php foreach ( $menus as $menu ) : ?> 419 <option<?php selected( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $menu->term_id ); ?> 420 value="<?php echo $menu->term_id; ?>"><?php echo $menu->name; ?></option> 421 <?php endforeach; ?> 422 </select> 423 </label> 424 </p> 425 <?php 426 } 427 ?> 428 <p class="button-controls"> 429 <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> 430 <input type="submit" class="button-primary" name="nav-menu-locations" value="<?php esc_attr_e( 'Save' ); ?>" /> 431 </p> 432 <?php 397 433 } 398 434
Note: See TracChangeset
for help on using the changeset viewer.