ext2type filter-hookWP 2.5.0

Filters file type based on the extension name.

Usage

add_filter( 'ext2type', 'wp_kama_ext2type_filter' );

/**
 * Function for `ext2type` filter-hook.
 * 
 * @param array[] $ext2type Multi-dimensional array of file extensions types keyed by the type of file.
 *
 * @return array[]
 */
function wp_kama_ext2type_filter( $ext2type ){

	// filter...
	return $ext2type;
}
$ext2type(array[])
Multi-dimensional array of file extensions types keyed by the type of file.

Changelog

Since 2.5.0 Introduced.

Where the hook is called

wp_get_ext_types()
ext2type
wp-includes/functions.php 3531-3544
return apply_filters(
	'ext2type',
	array(
		'image'       => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'heic', 'webp', 'avif' ),
		'audio'       => array( 'aac', 'ac3', 'aif', 'aiff', 'flac', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
		'video'       => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ),
		'document'    => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ),
		'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb' ),
		'interactive' => array( 'swf', 'key', 'ppt', 'pptx', 'pptm', 'pps', 'ppsx', 'ppsm', 'sldx', 'sldm', 'odp' ),
		'text'        => array( 'asc', 'csv', 'tsv', 'txt' ),
		'archive'     => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ),
		'code'        => array( 'css', 'htm', 'html', 'php', 'js' ),
	)
);

Where the hook is used in WordPress

Usage not found.