wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_get_image_editor_output_format › WordPress Function

Desde6.7.0
Obsoleton/a
wp_get_image_editor_output_format ( $filename, $mime_type )
Acesso:
  • private
Parâmetros: (2)
  • (string) $filename Path to the image.
    Required: Yes
  • (string) $mime_type The source image mime type.
    Required: Yes
Retorna:
  • (string[]) An array of mime type mappings.
Definido em:
Codex:

Determines the output format for the image editor.



Fonte

function wp_get_image_editor_output_format( $filename, $mime_type ) {
	/**
	 * Filters the image editor output format mapping.
	 *
	 * 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 WP_Image_Editor::get_output_format()
	 *
	 * @since 5.8.0
	 * @since 6.7.0 The default was changed from array() to array( 'image/heic' => 'image/jpeg' ).
	 *
	 * @param string[] $output_format {
	 *     An array of mime type mappings. Maps a source mime type to a new
	 *     destination mime type. Default maps uploaded HEIC images 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', array( 'image/heic' => 'image/jpeg' ), $filename, $mime_type );
}