wc_product_class( string|array $class = '', int|WP_Post|WC_Product $product_id = null )
Display the classes for the product div.
Description Description
Parameters Parameters
- $class
-
(Optional) One or more classes to add to the class list.
Default value: ''
- $product_id
-
(Optional) Product ID or product object.
Default value: null
Source Source
File: includes/wc-template-functions.php
function wc_product_class( $class = '', $product_id = null ) { echo 'class="' . esc_attr( implode( ' ', wc_get_product_class( $class, $product_id ) ) ) . '"'; }
Changelog Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |