filtrod 4.2.0
widget_nav_menu_args
Opis — z kodu źródłowego
Filters the arguments for the Navigation Menu widget.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$nav_menu_args | array | { 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_Term | Nav menu object for the current menu. |
$args | array | Display arguments for the current widget. |
$instance | array | Array 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
}
// 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