WordPress filter hook · part of WordPress core
widget_nav_menu_args
A WordPress core filter that 9 plugins also fire themselves, running on 203K+ sites between them.
“Filters the arguments for the Custom Menu widget.”
How to use widget_nav_menu_args
It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'widget_nav_menu_args', function( $nav_menu_args, $nav_menu, $settings ) {
// Change $nav_menu_args here.
return $nav_menu_args;
}, 10, 3 );Argument names come from Element Pack Addons for Elementor's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
9 plugins that fire widget_nav_menu_args
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
The Plus Addons for Elementor100,000+ installs
apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $settings, '' )modules/widgets/tp_navigation_menu_lite.php:2500 -
Element Pack Addons for Elementor100,000+ installs
apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $settings )modules/navbar/widgets/navbar.php:1107 -
Sky Addons for Elementor2,000+ installs
apply_filters( 'widget_nav_menu_args', $nav_args, $nav_menu, $settings )modules/nav-menu/widgets/nav-menu.php:1676 -
Nav Menu Manager800+ installs
apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args, $instance )includes/standalone/class-noakes-menu-widget.php:136 -
Accordion for WordPress100+ installs
apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args, $instance )includes/widgets/class-afwp-nav-menu-accordion-widget.php:100 -
Wow Elements Addons for Elementor60+ installs
apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $settings )includes/widgets/navbar.php:1205 -
Atomic Addons50+ installs
apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $settings )includes/widgets/mega-menu.php:2642 -
Master Accordion10+ installs
apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args, $instance )includes/widgets/class-mran-nav-menu-accordion-widget.php:86 -
Calio Addon for ElementorFewer than 10 installs
apply_filters( 'widget_nav_menu_args', $args, $menu, $s )src/Widgets/NavbarWidget.php:1379
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.