wp_nav_menu_args
Filter HookDescription
Filters the arguments used to display a navigation menu.Hook Information
File Location |
wp-includes/nav-menu-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 102 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$args
|
Array of wp_nav_menu() arguments. |
Usage Examples
Basic Usage
<?php
// Hook into wp_nav_menu_args
add_filter('wp_nav_menu_args', 'my_custom_filter', 10, 1);
function my_custom_filter($args) {
// Your custom filtering logic here
return $args;
}
Source Code Context
wp-includes/nav-menu-template.php:102
- How this hook is used in WordPress core
<?php
97 *
98 * @see wp_nav_menu()
99 *
100 * @param array $args Array of wp_nav_menu() arguments.
101 */
102 $args = apply_filters( 'wp_nav_menu_args', $args );
103 $args = (object) $args;
104
105 /**
106 * Filters whether to short-circuit the wp_nav_menu() output.
107 *
PHP Documentation
<?php
/**
* Filters the arguments used to display a navigation menu.
*
* @since 3.0.0
*
* @see wp_nav_menu()
*
* @param array $args Array of wp_nav_menu() arguments.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/nav-menu-template.php
Related Hooks
Related hooks will be displayed here in future updates.