# wp_get_image_editor_output_format()

URL: https://chugunov.pro/api-wordpress/functions/wp_get_image_editor_output_format/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 6.7.0.

## Сигнатура

```php
wp_get_image_editor_output_format( string $filename, string $mime_type ): string[]
```

## Описание

Определяет выходной формат для редактора изображений.

## Параметры

- `$filename` `string` — обязательный. Путь к изображению.
- `$mime_type` `string` — обязательный. MIME-тип исходного изображения.

## Возвращаемое значение

`string[]`

## Исходный код

Файл: `wp-includes/media.php:6371`

```php
function wp_get_image_editor_output_format( $filename, $mime_type ) {
	$output_format = array(
		'image/heic'          => 'image/jpeg',
		'image/heif'          => 'image/jpeg',
		'image/heic-sequence' => 'image/jpeg',
		'image/heif-sequence' => 'image/jpeg',
	);

	/**
	 * Filters the image editor output format mapping.
	 *
	 * Enables filtering the mime type used to save images. By default HEIC/HEIF images
	 * are converted to JPEGs.
	 *
	 * @see WP_Image_Editor::get_output_format()
	 *
	 * @since 5.8.0
	 * @since 6.7.0 The default was changed from an empty array to an array
	 *              containing the HEIC/HEIF images mime types.
	 *
	 * @param string[] $output_format {
	 *     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.
	 * }
	 * @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 );
}
```

## История изменений

- 6.7.0 — Introduced.

## Связанные

Использует: [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: `WP_Debug_Data::get_wp_media`, [`wp_create_image_subsizes`](https://chugunov.pro/api-wordpress/functions/wp_create_image_subsizes/), [`wp_unique_filename`](https://chugunov.pro/api-wordpress/functions/wp_unique_filename/), `WP_Image_Editor::get_output_format`, [`wp_get_image_editor`](https://chugunov.pro/api-wordpress/functions/wp_get_image_editor/), [`WP_Image_Editor`](https://chugunov.pro/api-wordpress/functions/wp_image_editor/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_get_image_editor_output_format/
