Merge pull request #18716 from woocommerce/fix/missing-image-size-18690

Fix product image on-the-fly generation
This commit is contained in:
Claudiu Lodromanean 2018-01-31 10:50:07 -08:00 committed by GitHub
commit 0886e5eab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 );
}