wppaste
WordPress

apply_filters( 'nav_menu_submenu_css_class', string[] $classes, stdClass $args, int $depth )

Since
4.8.0
Filters the CSS class(es) applied to a menu list element.

Compatibility

WordPress
since 4.8.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$classesstring[]
Array of the CSS classes that are applied to the menu <ul> element.
$argsstdClass
An object of wp_nav_menu() arguments.
$depthint
Depth of menu item. Used for padding.

Where this hook fires · 1

  • wp-includes/class-walker-nav-menu.php:92Walker_Nav_Menu::start_lvl()

Source code

		 * @since 4.8.0		 *		 * @param string[] $classes Array of the CSS classes that are applied to the menu `<ul>` element.		 * @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_submenu_css_class', $classes, $args, $depth ) ); 		$atts          = array();		$atts['class'] = ! empty( $class_names ) ? $class_names : ''; 		/**		 * Filters the HTML attributes applied to a menu list element.

Changelog

Introduced in 4.8.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.