diff --git a/includes/admin/meta-boxes/class-wc-meta-box-product-images.php b/includes/admin/meta-boxes/class-wc-meta-box-product-images.php index 4da33f854e4..d7a873f99c6 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-product-images.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-product-images.php @@ -38,14 +38,33 @@ class WC_Meta_Box_Product_Images { $attachments = array_filter( explode( ',', $product_image_gallery ) ); + $update_meta = false; + if ( ! empty( $attachments ) ) { foreach ( $attachments as $attachment_id ) { + $attachment = wp_get_attachment_image( $attachment_id, 'thumbnail' ); + + // if attachment is empty skip + if ( empty( $attachment ) ) { + $update_meta = true; + + continue; + } + echo '