Created
July 9, 2021 20:48
-
-
Save labmorales/26e5194a59a48c677b7463ecd027d366 to your computer and use it in GitHub Desktop.
How to make WP Crop Thumbnails plugin and Webp Express work together
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function convert_webp_crop_thumbnail($fullFilePath, $imageSizeName, $sizes) { | |
if (defined('WEBPEXPRESS_PLUGIN')) { | |
\WebPExpress\HandleUploadHooks::handleMakeIntermediateSize($fullFilePath); | |
} | |
} | |
add_action("crop_thumbnails_after_save_new_thumb", "convert_webp_crop_thumbnail", 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @labmorales ! This is something I'm very interested in.
As I understand this if for this cropping plugin:
https://github.com/vollyimnetz/crop-thumbnails
I have tried your code but I don't get any change, the image keeps uncropped. Do you have any advice?
Thanks.
EDIT:
Solved. It was apparently related to WP Super Cache.
In WP Super Cache's ADVANCED tab I had to set: