Merge pull request #18119 from woocommerce/fix/18104
Filter passed images before processing.
This commit is contained in:
commit
7a726123ce
|
@ -1046,7 +1046,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
* @return WC_Product
|
||||
*/
|
||||
protected function set_product_images( $product, $images ) {
|
||||
if ( is_array( $images ) && ! empty( $images ) ) {
|
||||
$images = is_array( $images ) ? array_filter( $images ) : array();
|
||||
|
||||
if ( ! empty( $images ) ) {
|
||||
$gallery = array();
|
||||
|
||||
foreach ( $images as $image ) {
|
||||
|
|
Loading…
Reference in New Issue