Check post type during read of product variations
Continuation of #12795
This commit is contained in:
parent
2cdf950963
commit
49095f0a6c
|
@ -37,7 +37,7 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
|
|||
public function read( &$product ) {
|
||||
$product->set_defaults();
|
||||
|
||||
if ( ! $product->get_id() || ! ( $post_object = get_post( $product->get_id() ) ) ) {
|
||||
if ( ! $product->get_id() || ! ( $post_object = get_post( $product->get_id() ) ) || 'product_variation' !== $post_object->post_type ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue