Make WordPress Core

#56973 closed defect (bug) (duplicate)

New update on class-walker-nav-menu.php missing menu-item-has-children class.

Reported by: innovext's profile innovext Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.1
Component: Menus Keywords:
Focuses: Cc:


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.

Change History (2)

#1 @audrasjb
20 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.1.1

Hello @innovext, thanks for the report and welcome to WordPress Core Trac,

Moving for 6.1.1 consideration.

Related: #28620 / [54478].

#2 @ocean90
20 months ago

  • Component changed from General to Menus
  • Keywords needs-patch removed
  • Milestone 6.1.1 deleted
  • Resolution set to duplicate
  • Severity changed from major to normal
  • Status changed from new to closed

Duplicate of #56946.

Note: See TracTickets for help on using tickets.