post_class_taxonomies хук-фильтрWP 6.1.0

Filters the taxonomies to generate classes for each individual term.

Default is all public taxonomies registered to the post type.

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

add_filter( 'post_class_taxonomies', 'wp_kama_post_class_taxonomies_filter', 10, 4 );

/**
 * Function for `post_class_taxonomies` filter-hook.
 * 
 * @param string[] $taxonomies List of all taxonomy names to generate classes for.
 * @param int      $post_id    The post ID.
 * @param string[] $classes    An array of post class names.
 * @param string[] $class      An array of additional class names added to the post.
 *
 * @return string[]
 */
function wp_kama_post_class_taxonomies_filter( $taxonomies, $post_id, $classes, $class ){

	// filter...
	return $taxonomies;
}
$taxonomies(string[])
List of all taxonomy names to generate classes for.
$post_id(int)
The post ID.
$classes(string[])
An array of post class names.
$class(string[])
An array of additional class names added to the post.

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

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

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

get_post_class()
post_class_taxonomies
wp-includes/post-template.php 563
$taxonomies = apply_filters( 'post_class_taxonomies', $taxonomies, $post->ID, $classes, $class );

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

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