get_product in product factory should return passed in object if its a product already
Fixes #6726
This commit is contained in:
parent
9e53b3fb33
commit
a076c5a69d
|
@ -27,10 +27,13 @@ class WC_Product_Factory {
|
|||
$the_product = $post;
|
||||
} elseif ( is_numeric( $the_product ) ) {
|
||||
$the_product = get_post( $the_product );
|
||||
} elseif ( $the_product instanceof WC_Product ) {
|
||||
return $the_product;
|
||||
}
|
||||
|
||||
if ( ! $the_product )
|
||||
if ( ! $the_product ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( is_object( $the_product ) ) {
|
||||
$product_id = absint( $the_product->ID );
|
||||
|
|
Loading…
Reference in New Issue