Ticket #13600: menu-item-parent-sanity-check.13600.diff
File menu-item-parent-sanity-check.13600.diff, 3.2 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/nav-menu.php
1006 1006 $result .= '</div>'; 1007 1007 1008 1008 if( empty($menu_items) ) 1009 return $result ;1009 return $result . ' <ul class="menu" id="menu-to-edit"> </ul>'; 1010 1010 1011 1011 $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id ); 1012 1012 … … 1024 1024 if ( $some_pending_menu_items ) 1025 1025 $result .= '<div class="updated inline"><p>' . __('Click Save Menu to make pending menu items public.') . '</p></div>'; 1026 1026 1027 $result .= '<ul class="menu" id="menu-to-edit"> '; 1027 1028 $result .= walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $menu_items), 0, (object) array('walker' => $walker ) ); 1029 $result .= ' </ul> '; 1028 1030 return $result; 1029 1031 } elseif ( is_wp_error( $menu ) ) { 1030 1032 return $menu; -
wp-admin/js/nav-menu.dev.js
93 93 if( depth == 0 ) { // Item is on the top level, has no parent 94 94 input.val(0); 95 95 } else { // Find the parent item, and retrieve its object id. 96 while( parent.menuItemDepth() != depth - 1 ) {96 while( ! parent[0] || ! parent[0].className || -1 == parent[0].className.indexOf('menu-item') || ( parent.menuItemDepth() != depth - 1 ) ) 97 97 parent = parent.prev(); 98 }99 98 input.val( parent.find('.menu-item-data-db-id').val() ); 100 99 } 101 100 }); -
wp-admin/nav-menus.php
562 562 </div><!-- END #nav-menu-header --> 563 563 <div id="post-body"> 564 564 <div id="post-body-content"> 565 <?php if ( is_nav_menu( $nav_menu_selected_id ) ) : ?> 566 <ul class="menu" id="menu-to-edit"> 567 <?php 565 <?php 566 if ( is_nav_menu( $nav_menu_selected_id ) ) : 568 567 $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); 569 if ( ! is_wp_error( $edit_markup ) ) {568 if ( ! is_wp_error( $edit_markup ) ) : 570 569 echo $edit_markup; 571 } 572 ?> 573 </ul> 574 <?php elseif ( empty($nav_menu_selected_id) ): 570 endif; 571 elseif ( empty( $nav_menu_selected_id ) ) : 575 572 echo '<div class="post-body-plain">'; 576 573 echo '<p>' . __('To create a custom menu, give it a name above and click Create Menu. Then choose items like pages, categories or custom links from the left column to add to this menu.') . '</p>'; 577 574 echo '<p>' . __('After you have added your items, drag and drop to put them in the order you want. You can also click each item to reveal additional configuration options.') . '</p>'; 578 575 echo '<p>' . __('When you have finished building your custom menu, make sure you click the Save Menu button.') . '</p>'; 579 576 echo '</div>'; 580 endif; ?> 577 endif; 578 ?> 581 579 </div><!-- /#post-body-content --> 582 580 </div><!-- /#post-body --> 583 581 </form><!-- /#update-nav-menu -->