wordpress / latest / hooks / image_editor_output_format.html

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_format string[]
An array of mime type mappings. Maps a source mime type to a new destination mime type. Default empty array.
  • ...$0string
    The new mime type.
$filename string
Path to the image.
$mime_type string
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 );

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