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
1611           'code' => array('css','html','php','js'),
1612      ));
1613      foreach ( $ext2type as $type => $exts )
1614           if ( in_array($ext, $exts) )
1615                return $type;
1616 }
1617
1618 function wp_check_filetype( $filename, $mimes = null ) {
1619      // Accepted MIME types are set here as PCRE unless provided.
1620      $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array(
1621           'jpg|jpeg|jpe' => 'image/jpeg',
1622           'gif' => 'image/gif',
1623           'png' => 'image/png',
1624           'bmp' => 'image/bmp',
1625           'tif|tiff' => 'image/tiff',
1626           'ico' => 'image/x-icon',
1627           'asf|asx|wax|wmv|wmx' => 'video/asf',
1628           'avi' => 'video/avi',
1629           'mov|qt' => 'video/quicktime',