wppaste
WordPress

apply_filters( 'image_editor_output_format', string[] $output_format, string $filename, string $mime_type )

Since
5.8.0, 6.7.0
Filters the image editor output format mapping.

Description

Enables filtering the mime type used to save images. By default HEIC/HEIF images are converted to JPEGs.

Compatibility

WordPress
since 6.7.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$output_formatstring[]
{ An array of mime type mappings. Maps a source mime type to a new destination mime type. By default maps HEIC/HEIF input to JPEG output.
@type string ...$0 The new mime type.
}
  • ...$0string

    The new mime type.
$filenamestring
Path to the image.
$mime_typestring
The source image mime type.

Where this hook fires · 1

  • wp-includes/media.php:6447wp_get_image_editor_output_format()

Source code

	 *	 *     @type string ...$0 The new mime type.	 * }	 * @param string $filename  Path to the image.	 * @param string $mime_type The source image mime type.	 */	return apply_filters( 'image_editor_output_format', $output_format, $filename, $mime_type );} 

Changelog

Introduced in 5.8.0. 2 changes between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

7.1.0
Parameter `` added.verified against source
7.1.0
Parameter $output_format removed.verified against source
6.7.0
The default was changed from an empty array to an array containing the HEIC/HEIF images mime types.from the docblock
5.8.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.