I am searching for a way to have newly uploaded and old one media files, which are set as featured image on a single post, duplicated into webp extension.

For this purpose, it seems that I need to use set_post_thumbnail hook under a logic: once a featured image is set, exectute cwebp or related library, to create a duplicate of this image in the same folder, appending webp extension.

I also searched for a post-hook that is being used at set_post_thumbnail but I found none, so I am not really sure how to achieve it or if I should use another method ie: save_post

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.