the_category_list filter-hookWP 4.4.0

Filters the categories before building the category list.

Usage

add_filter( 'the_category_list', 'wp_kama_the_category_list_filter', 10, 2 );

/**
 * Function for `the_category_list` filter-hook.
 * 
 * @param WP_Term[] $categories An array of the post's categories.
 * @param int|bool  $post_id    ID of the post we're retrieving categories for. When `false`, we assume the current post in the loop.
 *
 * @return WP_Term[]
 */
function wp_kama_the_category_list_filter( $categories, $post_id ){

	// filter...
	return $categories;
}
$categories(WP_Term[])
An array of the post's categories.
$post_id(int|true|false)
ID of the post we're retrieving categories for. When false, we assume the current post in the loop.

Changelog

Since 4.4.0 Introduced.

Where the hook is called

get_the_category_list()
the_category_list
wp-includes/category-template.php 157
$categories = apply_filters( 'the_category_list', get_the_category( $post_id ), $post_id );

Where the hook is used in WordPress

Usage not found.