From 3ba9063d3de30f455bb9be3455292bc0a61c0e30 Mon Sep 17 00:00:00 2001 From: dixitadusara Date: Fri, 7 Apr 2017 13:24:34 +0530 Subject: [PATCH] Invalid argument supplied for foreach - class-wc-product-data-store-cpt.php ref #14089 --- includes/data-stores/class-wc-product-data-store-cpt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/data-stores/class-wc-product-data-store-cpt.php b/includes/data-stores/class-wc-product-data-store-cpt.php index bb11561137c..70f36f382cd 100644 --- a/includes/data-stores/class-wc-product-data-store-cpt.php +++ b/includes/data-stores/class-wc-product-data-store-cpt.php @@ -309,7 +309,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da protected function read_attributes( &$product ) { $meta_values = maybe_unserialize( get_post_meta( $product->get_id(), '_product_attributes', true ) ); - if ( $meta_values ) { + if ( $meta_values && !empty( $meta_values ) ) { $attributes = array(); foreach ( $meta_values as $meta_value ) { if ( ! empty( $meta_value['is_taxonomy'] ) ) {