woocommerce_image_sizes_to_resize

woocommerce_image_sizes_to_resize

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_image_sizes_to_resize') is found 2 times:

  • /includes/class-wc-regenerate-images.php line 71
    	 * @param string $size Size name.
    	 * @return array
    	 */
    	public static function filter_image_get_intermediate_size( $data, $attachment_id, $size ) {
    		if ( ! is_string( $size ) || ! in_array( $size, apply_filters( 'woocommerce_image_sizes_to_resize', array( 'woocommerce_thumbnail', 'woocommerce_gallery_thumbnail', 'woocommerce_single' ) ), true ) ) {
    			return $data;
    		}
    
    		// If we don't have sizes, we cannot proceed.
    		if ( ! isset( $data['width'], $data['height'] ) ) {
    			return $data;
    
  • /includes/class-wc-regenerate-images.php line 207
    			return $image;
    		}
    
    		// List of sizes we want to resize. Ignore others.
    		if ( ! $image || ! in_array( $size, apply_filters( 'woocommerce_image_sizes_to_resize', array( 'woocommerce_thumbnail', 'woocommerce_gallery_thumbnail', 'woocommerce_single' ) ), true ) ) {
    			return $image;
    		}
    
    		$target_size      = wc_get_image_size( $size );
    		$image_width      = $image[1];
    		$image_height     = $image[2];