WP HOOKS
filtrod 6.3.0

nav_menu_item_attributes

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

Opis — z kodu źródłowego

Filters the HTML attributes applied to a menu's list item element.

Parametry

ParametrTypOpis
$li_attsarray{ The HTML attributes applied to the menu item's <code>&lt;li&gt;</code> element, empty strings are ignored. @type string $class HTML CSS class attribute. @type string $id HTML id attribute. }
$menu_item\WP_PostThe current menu item object.
$args\stdClassAn object of wp_nav_menu() arguments.
$depthintDepth 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
}

Popularne w tej kategorii