wp_nav_menu_remove_menu_item_has_children_class


wp_nav_menu_remove_menu_item_has_children_class ( $classes, $menu_item, $args = false, $depth = false )

Parameters:
  • (string[]) classes Array of the CSS classes that are applied to the menu item's `<li>` element.
  • (WP_Post) menu_item The current menu item object.
  • (stdClass|false) args An object of wp_nav_menu() arguments. Default false ($args unspecified when filter is called).
  • (int|false) depth Depth of menu item. Default false ($depth unspecified when filter is called).
See:
Returns:
  • (string[]) Modified nav menu classes.
Defined at:

Description

Remove the `menu-item-has-children` class from bottom level menu items.This runs on the {@see '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.

Related Functions

wp_nav_menu_update_menu_items, wp_nav_menu_post_type_meta_boxes, wp_nav_menu_item_link_meta_box, wp_nav_menu_item_post_type_meta_box, wp_nav_menu_taxonomy_meta_boxes

Top Google Results

User discussions

wpseek mobile