[wp-trac] [WordPress Trac] #56946: WP 6.1-RC6: `menu-item-has-children` class is not being applied correctly

WordPress Trac noreply at wordpress.org
Tue Nov 1 19:23:07 UTC 2022


#56946: WP 6.1-RC6: `menu-item-has-children` class is not being applied correctly
--------------------------+-----------------------------
 Reporter:  webmandesign  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When a theme has
 [https://developer.wordpress.org/reference/functions/wp_nav_menu/
 `wp_nav_menu()`] `depth` parameter set higher than `0`, WordPress 6.1-RC6
 stops applying `menu-item-has-children` class for sub-menu items
 correctly.

 This only happens when menu contains certain number of menu and sub-menu
 items - haven't found out the exact logic here though. But, for example,
 the issue is triggered when a theme has `depth=4` and menu has this
 structure:

 {{{
 Level 1
 - Level 2
 - - Level 3
 - - - Level 4
 - - - - Level 5
 - - - - - Level 6
 }}}

 The issue is not present if depth parameter is not set or is set to `0`.

 For testing check out my [https://wordpress.org/themes/michelle/ Michelle
 theme], for example, and use [https://codex.wordpress.org/Theme_Unit_Test
 theme unit test] with "All pages" menu set for "Primary" menu location.

 This worked perfectly fine with previous versions of WordPress, so I think
 it is a WP6.1 bug.

 For more info please visit https://wordpress.org/support/topic/wp-6-1-rc3
 -menu-item-has-children-class-is-not-being-applied-correctly/ thread where
 I've possibly [https://wordpress.org/support/topic/wp-6-1-rc3-menu-item-
 has-children-class-is-not-being-applied-correctly/#post-16153610 found a
 bug in the code and also proposed a solution].

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


More information about the wp-trac mailing list