Changeset 14852 for trunk/wp-admin/nav-menus.php
- Timestamp:
- 05/24/2010 07:50:20 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/nav-menus.php
r14833 r14852 319 319 320 320 if ( ! is_wp_error( $_menu_object ) ) { 321 $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') ); 321 $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') ); 322 $menu_items = array(); 323 // Index menu items by db ID 324 foreach( $unsorted_menu_items as $_item ) 325 $menu_items[$_item->db_id] = $_item; 326 322 327 $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' ); 323 328 wp_defer_term_counting(true); … … 357 362 358 363 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been updated.'), $nav_menu_selected_title ) . '</p></div>'; 359 unset( $menu_items );364 unset( $menu_items, $unsorted_menu_items ); 360 365 } 361 366 } … … 411 416 wp_nav_menu_setup(); 412 417 $messages[] = '<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>'; 413 414 // The theme supports neither menus nor widgets.415 } else {416 remove_meta_box( 'create-menu', 'nav-menus', 'side' );417 $messages[] = '<div id="message" class="error"><p>' . __('The current theme does not support menus.') . '</p></div>';418 418 } 419 419 … … 513 513 </div><!--END .major-publishing-actions--> 514 514 </div><!--END #submitpost .submitbox--> 515 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> 516 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> 517 <?php wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' ); ?> 515 <?php 516 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 517 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); 518 wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' ); 519 ?> 518 520 <input type="hidden" name="action" value="update" /> 519 521 <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
Note: See TracChangeset
for help on using the changeset viewer.