Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: upload_mimes

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1206           'code' => array('css','html','php','js'),
1207      ));
1208      foreach ( $ext2type as $type => $exts )
1209           if ( in_array($ext, $exts) )
1210                return $type;
1211 }
1212
1213 function wp_check_filetype( $filename, $mimes = null ) {
1214      // Accepted MIME types are set here as PCRE unless provided.
1215      $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array(
1216           'jpg|jpeg|jpe' => 'image/jpeg',
1217           'gif' => 'image/gif',
1218           'png' => 'image/png',
1219           'bmp' => 'image/bmp',
1220           'tif|tiff' => 'image/tiff',
1221           'ico' => 'image/x-icon',
1222           'asf|asx|wax|wmv|wmx' => 'video/asf',
1223           'avi' => 'video/avi',
1224           'mov|qt' => 'video/quicktime',