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.
107*108* @see wp_nav_menu()109*110* @param string|null$output Nav menu output to short-circuit with.Defaultnull.111* @param stdClass$args An object containing wp_nav_menu() arguments.112*/113$nav_menu=apply_filters('pre_wp_nav_menu',null,$args);114115if(null!==$nav_menu){116if($args->echo){117echo$nav_menu;118return;119}
History
Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.