Make wc_get_product() return false if the specified post is not a product
This commit is contained in:
parent
cb0f703086
commit
7561f772d9
|
@ -33,6 +33,10 @@ class WC_Product_Factory {
|
|||
|
||||
$classname = $this->get_product_class( $the_product, $args );
|
||||
|
||||
if ( ! $classname ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! class_exists( $classname ) ) {
|
||||
$classname = 'WC_Product_Simple';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue