From e982e4027a3be7a4b3693dc8030c6457d3dedec7 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 21 Feb 2019 17:37:16 +0000 Subject: [PATCH] unused variables --- includes/class-wc-regenerate-images.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/class-wc-regenerate-images.php b/includes/class-wc-regenerate-images.php index 60894574b8f..659d8e354b6 100644 --- a/includes/class-wc-regenerate-images.php +++ b/includes/class-wc-regenerate-images.php @@ -306,11 +306,6 @@ class WC_Regenerate_Images { * @return string */ private static function resize_and_return_image( $attachment_id, $image, $size, $icon ) { - $image_size = wc_get_image_size( $size ); - $wp_uploads = wp_upload_dir( null, false ); - $wp_uploads_dir = $wp_uploads['basedir']; - $wp_uploads_url = $wp_uploads['baseurl']; - if ( ! self::is_regeneratable( $attachment_id ) ) { return $image; } @@ -328,6 +323,8 @@ class WC_Regenerate_Images { self::$regenerate_size = is_customize_preview() ? $size . '_preview' : $size; if ( is_customize_preview() ) { + $image_size = wc_get_image_size( $size ); + // Make sure registered image size matches the size we're requesting. add_image_size( self::$regenerate_size, absint( $image_size['width'] ), absint( $image_size['height'] ), $image_size['crop'] );