category_list_link_attributes WordPress Filter Hook

The category_list_link_attributes hook allows you to modify the attributes of the links in the category list. This can be useful for adding or changing the classes or id attributes of the links.

apply_filters( 'category_list_link_attributes', array $atts, WP_Term $category, int $depth, array $args, int $current_object_id ) #

Filters the HTML attributes applied to a category list item’s anchor element.


Parameters

$atts

(array)The HTML attributes applied to the list item's <a> element, empty strings are ignored.

  • 'href'
    (string) The href attribute.
  • 'title'
    (string) The title attribute.

$category

(WP_Term)Term data object.

$depth

(int)Depth of category, used for padding.

$args

(array)An array of arguments.

$current_object_id

(int)ID of the current category.


Top ↑

Source

File: wp-includes/class-walker-category.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.