Plugin Author
Pedro
(@petredobrescu)
Hello @redkite,
You should be able to achieve that, with some custom coding (that decides what needs to be excluded) and this filter:
apply_filters('shortpixel/api/request', $requestParameters, $item_id);
In short, it filters the parameters sent to the optimization API (through $requestParameters), described in detail here: ShortPixel Reducer API; $item_id contains the ID of the Media Library item or the ID of the Custom Media item (when used). Basically, this filter can be used to alter any parameters sent to the API, depending on the needs. For example, you can set different resize parameters for different post types or certain images (you need to somehow identify those images from your custom code), you can set different compression levels, remove EXIF or not, covert WebP/AVIF, and pretty much any other parameter that is sent to the API for a specific image (together with all its thumbnails).
Alternatively, you can use the exclusions section, but that will exclude the image from the entire processing (meaning that it will not only be excluded from resizing, but also from optimizing, generating WebP/AVIF, etc.).
Looking forward to getting your confirmation about this!
Understood. Just to confirm, if I set a resizing limit to 1200px wide, that *will* size down the 1900px-wide hero image I upload into a block, right?
Plugin Author
Pedro
(@petredobrescu)
Yes, that’s the way the resize should work.
However, please note the following detail: depending on your theme, there might be thumbnails that are supposed to be generated with higher sizes (let’s take the 2048×2048 one). In this case, the thumbnail (that is generated by WordPress itself) will be named filename-2048x2048.jog, but the actual file will be resized according to the resize settings from ShortPixel (1200px in your case).
I hope that helps!
Got it, thanks for clarifying.
Plugin Author
Pedro
(@petredobrescu)
My pleasure!
I’ll mark this thread as Resolved now. Please write back here if you still have questions on this topic, otherwise, you can open a new thread!
All the best,
Pedro/ShortPixel team