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