Fixed $post when using product instance
This commit is contained in:
parent
c19836b0e4
commit
54b6174b34
|
@ -560,6 +560,7 @@ function wc_get_product_class( $class = '', $product_id = null ) {
|
|||
if ( is_a( $product_id, 'WC_Product' ) ) {
|
||||
$product = $product_id;
|
||||
$product_id = $product_id->get_id();
|
||||
$post = get_post( $product_id );
|
||||
} else {
|
||||
$post = get_post( $product_id );
|
||||
$product = wc_get_product( $post->ID );
|
||||
|
|
Loading…
Reference in New Issue