Make WordPress Core

Ticket #24942: 24942.2.diff

File 24942.2.diff, 2.7 KB (added by SergeyBiryukov, 12 years ago)
  • src/wp-admin/includes/deprecated.php

     
    10251025}
    10261026
    10271027/**
     1028 * This was once used to display a metabox for the nav menu theme locations.
     1029 *
     1030 * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen.
     1031 *
     1032 * @since 3.0.0
     1033 * @deprecated 3.6.0
     1034 */
     1035function wp_nav_menu_locations_meta_box() {
     1036        _deprecated_function( __FUNCTION__, '3.6' );   
     1037}
     1038
     1039/**
    10281040 * Get the real filesystem path to a file to edit within the admin.
    10291041 *
    10301042 * @since 1.5.0
  • src/wp-admin/includes/nav-menu.php

     
    485485}
    486486
    487487/**
    488  * Displays a metabox for the nav menu theme locations.
    489  *
    490  * @since 3.0.0
    491  */
    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 &#8220;Custom Menu&#8221; widget to add any menus you create here to the theme&#8217;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, '&hellip;' ); ?></option>
    518                                         <?php endforeach; ?>
    519                                 </select>
    520                         </label>
    521                 </p>
    522         <?php
    523         }
    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         <?php
    530 }
    531 
    532 /**
    533488 * Check whether to disable the Menu Locations meta box submit button
    534489 *
    535490 * @since 3.6.0