Fix - Illegal offset type in isset or empty
ref #17780 CC @kloon @shivapoudel
This commit is contained in:
parent
8ed6e7436f
commit
9cfdb6cbea
|
@ -66,7 +66,7 @@ class WC_Regenerate_Images {
|
||||||
|
|
||||||
$size_settings = wc_get_image_size( $size );
|
$size_settings = wc_get_image_size( $size );
|
||||||
|
|
||||||
if ( isset( $imagemeta['sizes'], $imagemeta['sizes'][ $size ] ) ) {
|
if ( is_string( $size ) && isset( $imagemeta['sizes'], $imagemeta['sizes'][ $size ] ) ) {
|
||||||
if ( $imagemeta['sizes'][ $size ]['width'] !== $size_settings['width'] || $imagemeta['sizes'][ $size ]['height'] !== $size_settings['height'] ) {
|
if ( $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 );
|
$image = self::resize_and_return_image( $attachment_id, $image, $size, $icon );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue