Ticket #24942: 24942-depr.diff
File 24942-depr.diff, 4.2 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/deprecated.php
1023 1023 _deprecated_function( __FUNCTION__, '3.5', 'image_resize()' ); 1024 1024 return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) ); 1025 1025 } 1026 1027 /** 1028 * Displays 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 */ 1035 function wp_nav_menu_locations_meta_box() { 1036 global $nav_menu_selected_id; 1037 1038 if ( ! current_theme_supports( 'menus' ) ) { 1039 // We must only support widgets. Leave a message and bail. 1040 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>'; 1041 return; 1042 } 1043 1044 $locations = get_registered_nav_menus(); 1045 $menus = wp_get_nav_menus(); 1046 $menu_locations = get_nav_menu_locations(); 1047 $num_locations = count( array_keys($locations) ); 1048 1049 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>'; 1050 1051 foreach ( $locations as $location => $description ) { 1052 ?> 1053 <p> 1054 <label class="howto" for="locations-<?php echo $location; ?>"> 1055 <span><?php echo $description; ?></span> 1056 <select name="menu-locations[<?php echo $location; ?>]" id="locations-<?php echo $location; ?>"> 1057 <option value="0"></option> 1058 <?php foreach ( $menus as $menu ) : ?> 1059 <option<?php selected( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $menu->term_id ); ?> 1060 value="<?php echo $menu->term_id; ?>"><?php echo wp_html_excerpt( $menu->name, 40, '…' ); ?></option> 1061 <?php endforeach; ?> 1062 </select> 1063 </label> 1064 </p> 1065 <?php 1066 } 1067 ?> 1068 <p class="button-controls"> 1069 <?php submit_button( __( 'Save' ), 'primary right', 'nav-menu-locations', false, wp_nav_menu_disabled_check( $nav_menu_selected_id ) ); ?> 1070 <span class="spinner"></span> 1071 </p> 1072 <?php 1073 } -
wp-admin/includes/nav-menu.php
487 487 } 488 488 489 489 /** 490 * Displays a metabox for the nav menu theme locations.491 *492 * @since 3.0.0493 */494 function wp_nav_menu_locations_meta_box() {495 global $nav_menu_selected_id;496 497 if ( ! current_theme_supports( 'menus' ) ) {498 // We must only support widgets. Leave a message and bail.499 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>';500 return;501 }502 503 $locations = get_registered_nav_menus();504 $menus = wp_get_nav_menus();505 $menu_locations = get_nav_menu_locations();506 $num_locations = count( array_keys($locations) );507 508 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>';509 510 foreach ( $locations as $location => $description ) {511 ?>512 <p>513 <label class="howto" for="locations-<?php echo $location; ?>">514 <span><?php echo $description; ?></span>515 <select name="menu-locations[<?php echo $location; ?>]" id="locations-<?php echo $location; ?>">516 <option value="0"></option>517 <?php foreach ( $menus as $menu ) : ?>518 <option<?php selected( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $menu->term_id ); ?>519 value="<?php echo $menu->term_id; ?>"><?php echo wp_html_excerpt( $menu->name, 40, '…' ); ?></option>520 <?php endforeach; ?>521 </select>522 </label>523 </p>524 <?php525 }526 ?>527 <p class="button-controls">528 <?php submit_button( __( 'Save' ), 'primary right', 'nav-menu-locations', false, wp_nav_menu_disabled_check( $nav_menu_selected_id ) ); ?>529 <span class="spinner"></span>530 </p>531 <?php532 }533 534 /**535 490 * Check whether to disable the Menu Locations meta box submit button 536 491 * 537 492 * @since 3.6.0