From e6d412093a6716ca67e844974af70a645d9d6758 Mon Sep 17 00:00:00 2001 From: Ramon Date: Sun, 3 Apr 2022 19:46:12 -0300 Subject: [PATCH] Update to check if the return of get_post_meta is an array --- plugins/woocommerce/includes/wc-product-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/wc-product-functions.php b/plugins/woocommerce/includes/wc-product-functions.php index d3c715a09c9..bced2009235 100644 --- a/plugins/woocommerce/includes/wc-product-functions.php +++ b/plugins/woocommerce/includes/wc-product-functions.php @@ -686,7 +686,7 @@ function wc_get_product_id_by_sku( $sku ) { */ function wc_get_product_variation_attributes( $variation_id ) { // Build variation data from meta. - $all_meta = array_filter( (array) get_post_meta( $variation_id ) ); + $all_meta = is_array( get_post_meta( $variation_id ) ) ? get_post_meta( $variation_id ) : array(); $parent_id = wp_get_post_parent_id( $variation_id ); $parent_attributes = array_filter( (array) get_post_meta( $parent_id, '_product_attributes', true ) ); $found_parent_attributes = array();