[wp-trac] [WordPress Trac] #56973: New update on class-walker-nav-menu.php missing menu-item-has-children class.

WordPress Trac noreply at wordpress.org
Thu Nov 3 06:16:47 UTC 2022


#56973: New update on class-walker-nav-menu.php missing menu-item-has-children
class.
--------------------------+-----------------------------
 Reporter:  innovext      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  6.1
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The new update tries to calculate the depth of menu and check if the depth
 is with in the args->depth parameter, which is fine, however the actual
 code to calculate depth was in the wrong place which results in incorrect
 depth, as a result some menu item will miss menu-item-has-children class.

 The code from line 209 to 215 of class-walker-nav-menu.php should be moved
 outside of the parent foreach loop, otherwise the
 $menu_items_with_children[ $menu_item->ID ] on 223 will be incorrect.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56973>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list