wp_nav_menu_remove_menu_item_has_children_class( string[] $classes, WP_Post $menu_item, stdClass|false $args = false, int|false $depth = false )
Remove the menu-item-has-children
class from bottom level menu items.
Description
This runs on the ‘nav_menu_css_class’ filter. The $args and $depth parameters were added after the filter was originally introduced in WordPress 3.0.0 so this needs to allow for cases in which the filter is called without them.
See also
Parameters
- $classes
-
(Required) Array of the CSS classes that are applied to the menu item's
<li>
element. - $menu_item
-
(Required) The current menu item object.
- $args
-
(Optional) An object of wp_nav_menu() arguments. Default false ($args unspecified when filter is called).
Default value: false
- $depth
-
(Optional) Depth of menu item. Default false ($depth unspecified when filter is called).
Default value: false
Return
(string[]) Modified nav menu classes.
Source
File: wp-includes/nav-menu-template.php
Changelog
Version | Description |
---|---|
6.2.0 | Introduced. |