Filters whether to short-circuit the wp_nav_menu() output.
Description
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.
Parameters
$outputstring|null
Nav menu output to short-circuit with. Default null.
112*113* @see wp_nav_menu()114*115* @param string|null$output Nav menu output to short-circuit with.Defaultnull.116* @param stdClass$args An object containing wp_nav_menu() arguments.117*/118$nav_menu=apply_filters('pre_wp_nav_menu',null,$args);119120if(null!==$nav_menu){121if($args->echo){122echo$nav_menu;123return;124}
History
Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.