[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 8 16:40:02 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: 6.1.1
Component: Menus | Version: 6.1
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+---------------------
Comment (by larsmqller):
Replying to [comment:19 nuvoPoint]:
> We are still having issues with line 223:
>
> ( $args->depth <= 0 || $menu_items_with_children[ $menu_item->ID ] <
$args->depth )
>
> This extra check was added in v.6.1 but is this necessary?
At least for my case when debugging $menu_items_with_children[
$menu_item->ID ] gives menu items id's to connect(expected with that
name), and those would close to all of the time be bigger than
$args->depth.
In my case wp_nav_menu is called with $args->depth = 0.
The extra check seems not to be necessary in my opinion also.
I did not take time to understand why this check could be needed based on
the related code.
Just wanted to share.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56946#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list