woocommerce_product_class

woocommerce_product_class

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_product_class') is found 1 times:

  • /includes/class-wc-product-factory.php line 61
    	 * @param  string $product_type Product type.
    	 * @return string
    	 */
    	public static function get_product_classname( $product_id, $product_type ) {
    		$classname = apply_filters( 'woocommerce_product_class', self::get_classname_from_product_type( $product_type ), $product_type, 'variation' === $product_type ? 'product_variation' : 'product', $product_id );
    
    		if ( ! $classname || ! class_exists( $classname ) ) {
    			$classname = 'WC_Product_Simple';
    		}
    
    		return $classname;
    

See this hook used in plugins: