Add caching to get image size
This commit is contained in:
parent
271c48e3af
commit
287d65ab65
|
@ -203,7 +203,14 @@ class WC_Regenerate_Images {
|
|||
return $image;
|
||||
}
|
||||
|
||||
// Get image size - use cache if set.
|
||||
$image_size = wp_cache_get( 'size-' . $size, 'regenerate-images' );
|
||||
|
||||
if ( ! $image_size ) {
|
||||
$image_size = wc_get_image_size( $size );
|
||||
wp_cache_set( 'size-' . $size, $image_size, 'regenerate-images' );
|
||||
}
|
||||
|
||||
$ratio_match = false;
|
||||
|
||||
// If '' is passed to either size, we test ratios against the original file. It's uncropped.
|
||||
|
|
Loading…
Reference in New Issue