On this page
apply_filters( 'image_editor_output_format', string[] $output_format, string $filename, string $mime_type )
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
File: wp-includes/class-wp-image-editor.php. View all references
$output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );
Related
Used By
| Used By | Description |
|---|---|
| wp_unique_filename() wp-includes/functions.php | Gets a filename that is sanitized and unique for the given directory. |
| WP_Image_Editor::get_output_format() wp-includes/class-wp-image-editor.php | Returns preferred mime-type and extension based on provided file’s extension and mime, or current file’s extension and mime. |
| wp_get_image_editor() wp-includes/media.php | Returns a WP_Image_Editor instance and loads file into it. |
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/image_editor_output_format