post_class filter-hookWC 1.0

This is a WordPress - post_class hook. The plugin just uses it.

Filters the list of CSS class names for the current post.

Usage

add_filter( 'post_class', 'wp_kama_post_class_filter', 10, 3 );

/**
 * Function for `post_class` filter-hook.
 * 
 * @param string[] $classes   An array of post class names.
 * @param string[] $css_class An array of additional class names added to the post.
 * @param int      $post_id   The post ID.
 *
 * @return string[]
 */
function wp_kama_post_class_filter( $classes, $css_class, $post_id ){

	// filter...
	return $classes;
}
$classes(string[])
An array of post class names.
$css_class(string[])
An array of additional class names added to the post.
$post_id(int)
The post ID.

Where the hook is called

wc_get_product_class()
post_class
woocommerce/includes/wc-template-functions.php 652
$post_classes = apply_filters( 'post_class', $post_classes, $class, $product->get_id() );

Where the hook is used in WooCommerce

woocommerce/includes/wc-template-functions.php 649
remove_filter( 'post_class', 'wc_product_post_class', 20 );
woocommerce/includes/wc-template-functions.php 655
add_filter( 'post_class', 'wc_product_post_class', 20, 3 );
woocommerce/includes/wc-template-hooks.php 14
add_filter( 'post_class', 'wc_product_post_class', 20, 3 );