Convert image format to WebP while uploading an image via REST API
-
I would like to convert image format to WebP while uploading an image via REST API.
Usually, I use this function to generate WebP format from the original image resource while uploading media via GUI.
add_filter( 'wp_generate_attachment_metadata', 'custom_function_generate_webp_format', 10, 2 );
But this function does not work with the REST API Uploading Media method, which is described in the link below.
https://developer.www.ads-software.com/rest-api/reference/media/#create-a-media-item
Any idea that can convert the image format while uploading with REST API?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Convert image format to WebP while uploading an image via REST API’ is closed to new replies.