diff --git a/includes/class-wc-regenerate-images.php b/includes/class-wc-regenerate-images.php index 8970bd6b513..a578d293de8 100644 --- a/includes/class-wc-regenerate-images.php +++ b/includes/class-wc-regenerate-images.php @@ -69,7 +69,7 @@ class WC_Regenerate_Images { $size_settings = wc_get_image_size( $size ); // If size differs from image meta, regen. - if ( isset( $imagemeta['sizes'], $imagemeta['sizes'][ $size ] ) && ( $imagemeta['sizes'][ $size ]['width'] !== $size_settings['width'] || $imagemeta['sizes'][ $size ]['height'] !== $size_settings['height'] ) ) { + if ( ! isset( $imagemeta['sizes'], $imagemeta['sizes'][ $size ] ) || $imagemeta['sizes'][ $size ]['width'] !== $size_settings['width'] || $imagemeta['sizes'][ $size ]['height'] !== $size_settings['height'] ) { $image = self::resize_and_return_image( $attachment_id, $image, $size, $icon ); }