the_category filter-hookWP 1.2.0

Filters the category or list of categories.

Usage

add_filter( 'the_category', 'wp_kama_the_category_filter', 10, 3 );

/**
 * Function for `the_category` filter-hook.
 * 
 * @param string $thelist   List of categories for the current post.
 * @param string $separator Separator used between the categories.
 * @param string $parents   How to display the category parents. Accepts 'multiple', 'single', or empty.
 *
 * @return string
 */
function wp_kama_the_category_filter( $thelist, $separator, $parents ){

	// filter...
	return $thelist;
}
$thelist(string)
List of categories for the current post.
$separator(string)
Separator used between the categories.
$parents(string)
How to display the category parents. Accepts 'multiple', 'single', or empty.

Changelog

Since 1.2.0 Introduced.

Where the hook is called

get_the_category_list()
the_category
wp_popular_terms_checklist()
the_category
wp_link_category_checklist()
the_category
Walker_Category_Checklist::start_el()
the_category
wp-includes/category-template.php 229
return apply_filters( 'the_category', $thelist, $separator, $parents );
wp-includes/category-template.php 145
return apply_filters( 'the_category', '', $separator, $parents );
wp-includes/category-template.php 161
return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
wp-admin/edit-tags.php 625
'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category' ) ), '', '' ) . '</strong>'
wp-admin/includes/template.php 248
echo esc_html( apply_filters( 'the_category', $term->name, '', '' ) );
wp-admin/includes/template.php 296
$name    = esc_html( apply_filters( 'the_category', $category->name, '', '' ) );
wp-admin/includes/class-walker-category-checklist.php 108
esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
wp-admin/includes/class-walker-category-checklist.php 118
esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';

Where the hook is used in WordPress

Usage not found.