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 |
---|---|
2215 | * |
2216 | * @package WordPress |
2217 | * @since 2.5.0 |
2218 | * @uses apply_filters() Calls 'ext2type' hook on default supported types. |
2219 | * |
2220 | * @param string $ext The extension to search. |
2221 | * @return string|null The file type, example: audio, video, document, spreadsheet, etc. Null if not found. |
2222 | */ |
2223 | function wp_ext2type( $ext ) { |
2224 | $ext2type = apply_filters('ext2type', array( |
2225 | 'audio' => array('aac','ac3','aif','aiff','mp1','mp2','mp3','m3a','m4a','m4b','ogg','ram','wav','wma'), |
2226 | 'video' => array('asf','avi','divx','dv','mov','mpg','mpeg','mp4','mpv','ogm','qt','rm','vob','wmv', 'm4v'), |
2227 | 'document' => array('doc','docx','pages','odt','rtf','pdf'), |
2228 | 'spreadsheet' => array('xls','xlsx','numbers','ods'), |
2229 | 'interactive' => array('ppt','pptx','key','odp','swf'), |
2230 | 'text' => array('txt'), |
2231 | 'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'), |
2232 | 'code' => array('css','html','php','js'), |
2233 | )); |