WP HOOKS
filtrod 3.0.0

walker_nav_menu_start_el

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

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

ParametrTypOpis
$item_outputstringThe menu item's starting HTML output.
$menu_item\WP_PostMenu item data object.
$depthintDepth of menu item. Used for padding.
$args\stdClassAn 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
}

Popularne w tej kategorii