filtrod 6.3.0
nav_menu_item_attributes
Opis — z kodu źródłowego
Filters the HTML attributes applied to a menu's list item element.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$li_atts | array | { The HTML attributes applied to the menu item's <code><li></code> element, empty strings are ignored. @type string $class HTML CSS class attribute. @type string $id HTML id attribute. } |
$menu_item | \WP_Post | The current menu item object. |
$args | \stdClass | An object of wp_nav_menu() arguments. |
$depth | int | Depth of menu item. Used for padding. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'nav_menu_item_attributes', '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( 'nav_menu_item_attributes', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii