WP HOOKS
filtrod 4.2.0

widget_nav_menu_args

Args 4Plik wp-includes/widgets/class-wp-nav-menu-widget.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the arguments for the Navigation Menu widget.

Parametry

ParametrTypOpis
$nav_menu_argsarray{ An array of arguments passed to wp_nav_menu() to retrieve a navigation menu. @type callable|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty. @type mixed $menu Menu ID, slug, or name. }
$nav_menu\WP_TermNav menu object for the current menu.
$argsarrayDisplay arguments for the current widget.
$instancearrayArray of settings for the current widget.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'widget_nav_menu_args', 'twoja_funkcja', 10, 4 );

function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
	// Twój kod
}

Popularne w tej kategorii