WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
2347 | * |
2348 | * @package WordPress |
2349 | * @since 2.5.0 |
2350 | * @uses apply_filters() Calls 'ext2type' hook on default supported types. |
2351 | * |
2352 | * @param string $ext The extension to search. |
2353 | * @return string|null The file type, example: audio, video, document, spreadsheet, etc. Null if not found. |
2354 | */ |
2355 | function wp_ext2type( $ext ) { |
2356 | $ext2type = apply_filters( 'ext2type', array( |
2357 | 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ), |
2358 | 'video' => array( 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ), |
2359 | 'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'rtf', 'wp', 'wpd' ), |
2360 | 'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsb', 'xlsm' ), |
2361 | 'interactive' => array( 'key', 'ppt', 'pptx', 'pptm', 'odp', 'swf' ), |
2362 | 'text' => array( 'asc', 'csv', 'tsv', 'txt' ), |
2363 | 'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip' ), |
2364 | 'code' => array( 'css', 'htm', 'html', 'php', 'js' ), |
2365 | )); |