filtrod 3.0.0
walker_nav_menu_start_el
Opis — z kodu źródłowego
Filters a menu item's starting output.
The menu item's starting output only includes $args->before, the opening <a>, the menu item's title, the closing </a>, and $args->after. Currently, there is no filter for modifying the opening and closing <li> for a menu item.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$item_output | string | The menu item's starting HTML output. |
$menu_item | \WP_Post | Menu item data object. |
$depth | int | Depth of menu item. Used for padding. |
$args | \stdClass | An object of wp_nav_menu() arguments. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'walker_nav_menu_start_el', '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( 'walker_nav_menu_start_el', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii