getimagesize_mimes_to_exts filter-hookWP 3.0.0

Filters the list mapping image mime types to their respective extensions.

Usage

add_filter( 'getimagesize_mimes_to_exts', 'wp_kama_getimagesize_mimes_to_exts_filter' );

/**
 * Function for `getimagesize_mimes_to_exts` filter-hook.
 * 
 * @param array $mime_to_ext Array of image mime types and their matching extensions.
 *
 * @return array
 */
function wp_kama_getimagesize_mimes_to_exts_filter( $mime_to_ext ){

	// filter...
	return $mime_to_ext;
}
$mime_to_ext(array)
Array of image mime types and their matching extensions.

Changelog

Since 3.0.0 Introduced.

Where the hook is called

wp_check_filetype_and_ext()
getimagesize_mimes_to_exts
wp-includes/functions.php 3111-3122
$mime_to_ext = apply_filters(
	'getimagesize_mimes_to_exts',
	array(
		'image/jpeg' => 'jpg',
		'image/png'  => 'png',
		'image/gif'  => 'gif',
		'image/bmp'  => 'bmp',
		'image/tiff' => 'tif',
		'image/webp' => 'webp',
		'image/avif' => 'avif',
	)
);

Where the hook is used in WordPress

Usage not found.