WP HOOKS
filtrod 3.9.0

pre_wp_nav_menu

Args 2Plik wp-includes/nav-menu-template.phpDokumentacja WP ↗

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

ParametrTypOpis
$outputstring | nullNav menu output to short-circuit with. Default null.
$args\stdClassAn 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
}

Popularne w tej kategorii