image_editor_output_format WordPress Filter Hook

The image_editor_output_format hook is used to set the image editor output format. This hook is called after the image is loaded into the editor.

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.

Top ↑

See also


Top ↑

Parameters

$output_format

(string[])An array of mime type mappings. Maps a source mime type to a new destination mime type. Default empty array.

  • '...$0'
    (string) The new mime type.

$filename

(string)Path to the image.

$mime_type

(string)The source image mime type.


Top ↑

Source

File: wp-includes/class-wp-image-editor.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.