page_menu_link_attributes хук-фильтр . WP 4.8.0
Filters the HTML attributes applied to a page menu item's anchor element.
Использование
add_filter( 'page_menu_link_attributes', 'filter_function_name_3552', 10, 5 ); function filter_function_name_3552( $atts, $page, $depth, $args, $current_page ){ // filter... return $atts; }
- $atts(массив)
The HTML attributes applied to the menu item's <a> element, empty strings are ignored.
-
href(строка)
The href attribute. - aria_current(строка)
The aria-current attribute.
-
- $page(WP_Post)
- Page data object.
- $depth(число)
- Depth of page, used for padding.
- $args(массив)
- An array of arguments.
- $current_page(число)
- ID of the current page.
Список изменений
С версии 4.8.0 | Введена. |
Где вызывается хук
wp-includes/class-walker-page.php 183
$atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );