filtrod 3.9.0
pre_wp_nav_menu
Opis — z kodu źródłowego
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.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$output | string | null | Nav menu output to short-circuit with. Default null. |
$args | \stdClass | An object containing wp_nav_menu() arguments. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_wp_nav_menu', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_wp_nav_menu', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii