Ensure wp_list_pluck() gets a array and not possibly null
This commit is contained in:
parent
c2da2afa6d
commit
7b4075f11a
|
@ -744,7 +744,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
} elseif ( $attribute->is_taxonomy() ) {
|
} elseif ( $attribute->is_taxonomy() ) {
|
||||||
wp_set_object_terms( $product->get_id(), wp_list_pluck( $attribute->get_terms(), 'term_id' ), $attribute->get_name() );
|
wp_set_object_terms( $product->get_id(), wp_list_pluck( (array) $attribute->get_terms(), 'term_id' ), $attribute->get_name() );
|
||||||
} else {
|
} else {
|
||||||
$value = wc_implode_text_attributes( $attribute->get_options() );
|
$value = wc_implode_text_attributes( $attribute->get_options() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue