[wp-trac] [WordPress Trac] #12566: Menu editor link (URL) disappears (and other menu weirdness)

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 21 00:49:23 UTC 2010


#12566: Menu editor link (URL) disappears (and other menu weirdness)
--------------------------+-------------------------------------------------
 Reporter:  Dickie        |        Owner:  ptahdunbar
     Type:  defect (bug)  |       Status:  assigned  
 Priority:  high          |    Milestone:  3.0       
Component:  Menus         |      Version:  3.0       
 Severity:  blocker       |   Resolution:            
 Keywords:  accepted      |  
--------------------------+-------------------------------------------------

Comment(by graynotgrey):

 The following code segment in the nav-menu-template.php starting at line
 126 pertains to the indention of the child menus.

 {{{
                 // Indent children
                 $last_item = ( count( $menu_items ) ==
 $menu_item->menu_order );
                 if ( $last_item || $current_parent != $menu_items[$key +
 1]->post_parent ) {
                         if ( $last_item || in_array( $menu_items[$key +
 1]->post_parent, $parent_stack ) ) {
                                 $items .= '</li>';
                                 while ( !empty( $parent_stack ) &&
 ($last_item || $menu_items[$key + 1]->post_parent != $current_parent ) ) {
                                         $items .= '</ul></li>';
                                         $current_parent = array_pop(
 $parent_stack );
                                 }
                         } else {
                                 array_push( $parent_stack, $current_parent
 );
                                 $current_parent = $menu_item->ID;
                                 $items .= '<ul class="sub-menu">';
                         }
                 } else {
                         $items .= '</li>';
                 }
 }}}

 With the help of Firebug I discovered that for some reason, the first
 option in the If statement is always being skipped over and the <ul class
 ="sub-menu"> in the first else statement is being applied to each sub-item
 and thus indenting each sub-menu. This is as far as I can take it.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12566#comment:22>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list