Merge pull request #12970 from thenbrent/check_variation_post_type

Check post type during read of product variations
This commit is contained in:
Mike Jolley 2017-01-25 00:08:54 +00:00 committed by GitHub
commit ea817a5c88
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}