[wp-trac] [WordPress Trac] #28620: When $depth argument is used in wp_nav_menu last level menu items still have .menu-item-has-children class, even though they are not shown

WordPress Trac noreply at wordpress.org
Fri Dec 16 02:38:25 UTC 2022


#28620: When $depth argument is used in wp_nav_menu last level menu items still
have .menu-item-has-children class, even though they are not shown
-------------------------------------------------+-------------------------
 Reporter:  slobodanmanic                        |       Owner:  audrasjb
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1
Component:  Menus                                |     Version:  3.7
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:  ui
  tests commit                                   |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 In [changeset:"54999" 54999]:
 {{{
 #!CommitTicketReference repository="" revision="54999"
 Menus: Prevent infinite loop in menus.

 This modifies how the `menu-item-has-children` class is removed from
 bottom level menu items. Instead of removing the class within
 `wp_nav_menu()` a filter is applied to the `nav_menu_css_class` hook to
 remove the class as required.

 Introduces `wp_nav_menu_remove_menu_item_has_children_class()` for
 removing the class.

 Reverts source code changes in [54478,54801], the tests are retained.

 Props davidbinda, SergeyBiryukov, mhkuu, JeffPaul, jmdodd, priethor,
 desrosj, hellofromTonya, azaozz, peterwilsoncc.
 Fixes #56926.
 See #28620.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/28620#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list