I have custom post type “Product” with custom taxonomy “Product category”.
I use Advanced Custom Fields Pro plugin to extend my Product category with an uploaded image (so users may upload an image to each category).
Then, I have Smush Pro with enabled CDN. The CDN works for all images as expected. Except for the Product category images.
I tried following approaches to get the image URL.
First, ACF image field was set to return directly image’s URL.
Second, I change image’s return type to ID and then call wp_get_attachment_image_url($my_category_image_id,”size”:wink: to get the URL.
Last, I tried to set image return’s value to array.
In all cases, I got non-CDN URLs.
Other images uploaded via ACF’s custom fields work. Images are smushed. Cache cleared.
I tried to use smushed images from my media library as well as upload new image (auto smush is on).
I can’t figure out what is wrong. I tested all possible scenarios but these particular product categories’ images are simply not served via CDN.
Is there any WP filter to process URL of an image to get CDN’s URL if on?
Thank you in advance