Opened 6 years ago
Last modified 3 years ago
#47436 new defect (bug)
Menu depth doesn't affect menu-item-has-children
Reported by: | mikeybinns | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | trivial | Version: | 5.2.1 |
Component: | Menus | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Hi,
When you add a depth of 1 to wp_nav_menu it removes all the sub menus, but it leaves menu-item-has-children class on the original menu li tags, which means it is styled like it has a dropdown.
Attachments (2)
Change History (5)
#2
@
6 years ago
- Keywords needs-patch added; has-patch removed
These patches work for the first depth (the main line) but the class is also added to lower level submenus.
Example:
Depth = 1 <li class="no-class"> <a>menu item</a> </li> Depth = 2 <li class="menu-item-has-children"> <a>menu item</a> <ul class="sub-menu"> <li class="menu-item-has-children"> <a>2nd depth menu item with removed submenu</a> </li> </ul> </li>
I think this needs some kind of depth iterator, so the function knows the max depth and the current item depth.
Thanks,
Mikey
Note: See
TracTickets for help on using
tickets.