Filters the CSS classes applied to a menu item's list item element.
$classesstring[]$argsstdClass$depthintwp-includes/class-walker-nav-menu.php:194Walker_Nav_Menu::start_el() * * @param string[] $classes Array of the CSS classes that are applied to the menu item's `<li>` element. * @param WP_Post $menu_item The current menu item object. * @param stdClass $args An object of wp_nav_menu() arguments. * @param int $depth Depth of menu item. Used for padding. */ $class_names = implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $menu_item, $args, $depth ) ); /** * Filters the ID attribute applied to a menu item's list item element. * * @since 3.0.1 * @since 4.1.0 The `$depth` parameter was added.Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.