Filters the image editor output format mapping.
Description
Enables filtering the mime type used to save images. By default, the mapping array is empty, so the mime type matches the source image.
See also
Parameters
$output_formatstring[]- An array of mime type mappings. Maps a source mime type to a new destination mime type. Default empty array.
...$0stringThe new mime type.
$filenamestring- Path to the image.
$mime_typestring- The source image mime type.
Source
* Double-check that the mime-type selected is supported by the editor.
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |
Use this filter to output WebP images when users upload JPEG images: