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 |
|---|---|
| 2419 | * |
| 2420 | * @package WordPress |
| 2421 | * @since 2.5.0 |
| 2422 | * @uses apply_filters() Calls 'ext2type' hook on default supported types. |
| 2423 | * |
| 2424 | * @param string $ext The extension to search. |
| 2425 | * @return string|null The file type, example: audio, video, document, spreadsheet, etc. Null if not found. |
| 2426 | */ |
| 2427 | function wp_ext2type( $ext ) { |
| 2428 | $ext2type = apply_filters( 'ext2type', array( |
| 2429 | 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ), |
| 2430 | 'video' => array( 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ), |
| 2431 | 'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'rtf', 'wp', 'wpd' ), |
| 2432 | 'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsb', 'xlsm' ), |
| 2433 | 'interactive' => array( 'key', 'ppt', 'pptx', 'pptm', 'odp', 'swf' ), |
| 2434 | 'text' => array( 'asc', 'csv', 'tsv', 'txt' ), |
| 2435 | 'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip' ), |
| 2436 | 'code' => array( 'css', 'htm', 'html', 'php', 'js' ), |
| 2437 | )); |