the_category хук-фильтрWP 1.2.0

Filters the category or list of categories.

Использование

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(строка)
List of categories for the current post.
$separator(строка)
Separator used between the categories.
$parents(строка)
How to display the category parents. Accepts 'multiple', 'single', or empty.

Список изменений

С версии 1.2.0 Введена.

Где вызывается хук

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 230
return apply_filters( 'the_category', $thelist, $separator, $parents );
wp-includes/category-template.php 146
return apply_filters( 'the_category', '', $separator, $parents );
wp-includes/category-template.php 162
return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
wp-admin/edit-tags.php 630
'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category' ) ), '', '' ) . '</strong>'
wp-admin/includes/template.php 250
echo esc_html( apply_filters( 'the_category', $term->name, '', '' ) );
wp-admin/includes/template.php 298
$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>';

Где используется хук в WordPress

Использование не найдено.