wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_get_image_editor_output_format is private and should not be used in themes or plugins directly.
wp_get_image_editor_output_format › WordPress Function
Depuis6.7.0
Dépréciéen/a
› wp_get_image_editor_output_format ( $filename, $mime_type )
| Accès: |
|
| Paramètres: (2) |
|
| Retourne: |
|
| Défini(e) dans: |
|
| Codex: |
Determines the output format for the image editor.
Fonctions en relation: wp_image_editor_supports, wp_get_image_editor, _wp_get_iframed_editor_assets, wp_image_editor, _wp_get_image_size_from_meta
Source
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 array<string, 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.
* @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 );
}