category_css_class WordPress Filter Hook

The category_css_class hook allows you to add a custom CSS class to a category. This can be useful if you want to style a certain category differently from the others.

apply_filters( 'category_css_class', string[] $css_classes, WP_Term $category, int $depth, array $args ) #

Filters the list of CSS classes to include with each category in the list.


Description

Top ↑

See also


Top ↑

Parameters

$css_classes

(string[])An array of CSS classes to be applied to each list item.

$category

(WP_Term)Category data object.

$depth

(int)Depth of page, used for padding.

$args

(array)An array of wp_list_categories() arguments.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.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.