wppaste
WordPress

wp_get_ext_types(): array[]

Since
4.6.0
Source
wp-includes/functions.php:3607
Retrieves the list of common file extensions and their types.

Return

array[]
Multi-dimensional array of file extensions types keyed by the type of file.

Hooks fired · 1

One hook fires while wp_get_ext_types() runs, in this order:

  1. apply_filters( ext2type )filterline 3618 (+11 into the body)

    Filters file type based on the extension name.

Uses · 1

  • apply_filters()Calls the callback functions that have been added to a filter hook.

Used by · 3

Source

function wp_get_ext_types() { 	/**	 * Filters file type based on the extension name.	 *	 * @since 2.5.0	 *	 * @see wp_ext2type()	 *	 * @param array[] $ext2type Multi-dimensional array of file extensions types keyed by the type of file.	 */	return apply_filters(		'ext2type',		array(			'image'       => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'heic', 'heif', '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' ),		)	);}

History

Introduced in 4.6.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.