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
2027  *
2028  * @since 2.0.4
2029  *
2030  * @param string $filename File name or path.
2031  * @param array $mimes Optional. Key is the file extension with value as the mime type.
2032  * @return array Values with extension first and mime type.
2033  */
2034 function wp_check_filetype( $filename, $mimes = null ) {
2035      // Accepted MIME types are set here as PCRE unless provided.
2036      $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array(
2037           'jpg|jpeg|jpe' => 'image/jpeg',
2038           'gif' => 'image/gif',
2039           'png' => 'image/png',
2040           'bmp' => 'image/bmp',
2041           'tif|tiff' => 'image/tiff',
2042           'ico' => 'image/x-icon',
2043           'asf|asx|wax|wmv|wmx' => 'video/asf',
2044           'avi' => 'video/avi',
2045           'divx' => 'video/divx',