nav_menu_submenu_attributes
Filter HookDescription
Filters the HTML attributes applied to a menu list element. }Hook Information
File Location |
wp-includes/class-walker-nav-menu.php
View on GitHub
|
Hook Type | Filter |
Line Number | 110 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$atts
|
{ The HTML attributes applied to the `
|
stdClass
|
$args
|
An object of `wp_nav_menu()` arguments. |
int
|
$depth
|
Depth of menu item. Used for padding. |
Usage Examples
Basic Usage
<?php
// Hook into nav_menu_submenu_attributes
add_filter('nav_menu_submenu_attributes', 'my_custom_filter', 10, 3);
function my_custom_filter($atts, $args, $depth) {
// Your custom filtering logic here
return $atts;
}
Source Code Context
wp-includes/class-walker-nav-menu.php:110
- How this hook is used in WordPress core
<?php
105 * @type string $class HTML CSS class attribute.
106 * }
107 * @param stdClass $args An object of `wp_nav_menu()` arguments.
108 * @param int $depth Depth of menu item. Used for padding.
109 */
110 $atts = apply_filters( 'nav_menu_submenu_attributes', $atts, $args, $depth );
111 $attributes = $this->build_atts( $atts );
112
113 $output .= "{$n}{$indent}<ul{$attributes}>{$n}";
114 }
115
PHP Documentation
<?php
/**
* Filters the HTML attributes applied to a menu list element.
*
* @since 6.3.0
*
* @param array $atts {
* The HTML attributes applied to the `<ul>` element, empty strings are ignored.
*
* @type string $class HTML CSS class attribute.
* }
* @param stdClass $args An object of `wp_nav_menu()` arguments.
* @param int $depth Depth of menu item. Used for padding.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/class-walker-nav-menu.php
Related Hooks
Related hooks will be displayed here in future updates.