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 |
---|---|
1999 | * |
2000 | * @package WordPress |
2001 | * @since 2.5.0 |
2002 | * @uses apply_filters() Calls 'ext2type' hook on default supported types. |
2003 | * |
2004 | * @param string $ext The extension to search. |
2005 | * @return string|null The file type, example: audio, video, document, spreadsheet, etc. Null if not found. |
2006 | */ |
2007 | function wp_ext2type( $ext ) { |
2008 | $ext2type = apply_filters('ext2type', array( |
2009 | 'audio' => array('aac','ac3','aif','aiff','mp1','mp2','mp3','m3a','m4a','m4b','ogg','ram','wav','wma'), |
2010 | 'video' => array('asf','avi','divx','dv','mov','mpg','mpeg','mp4','mpv','ogm','qt','rm','vob','wmv'), |
2011 | 'document' => array('doc','docx','pages','odt','rtf','pdf'), |
2012 | 'spreadsheet' => array('xls','xlsx','numbers','ods'), |
2013 | 'interactive' => array('ppt','pptx','key','odp','swf'), |
2014 | 'text' => array('txt'), |
2015 | 'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'), |
2016 | 'code' => array('css','html','php','js'), |
2017 | )); |