pre_wp_nav_menu filter-hook . WP 3.9.0
Filters whether to short-circuit the wp_nav_menu() output.
Returning a non-null value from the filter will short-circuit wp_nav_menu(), echoing that value if $args->echo is true, returning that value otherwise.
Usage
add_filter( 'pre_wp_nav_menu', 'filter_function_name_809', 10, 2 ); function filter_function_name_809( $output, $args ){ // filter... return $output; }
- $output(string/null)
- Nav menu output to short-circuit with.
Default: null - $args(stdClass)
- An object containing wp_nav_menu() arguments.
Changelog
Since 3.9.0 | Introduced. |
Where the hook is called
pre_wp_nav_menu
wp-includes/nav-menu-template.php 113
$nav_menu = apply_filters( 'pre_wp_nav_menu', null, $args );