Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: getimagesize_mimes_to_exts

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
2308
2309           if ( $real_mime && $real_mime != $type ) {
2310                /**
2311                 * Filters the list mapping image mime types to their respective extensions.
2312                 *
2313                 * @since 3.0.0
2314                 *
2315                 * @param  array $mime_to_ext Array of image mime types and their matching extensions.
2316                 */
2317                $mime_to_ext = apply_filters( 'getimagesize_mimes_to_exts', array(
2318                     'image/jpeg' => 'jpg',
2319                     'image/png'  => 'png',
2320                     'image/gif'  => 'gif',
2321                     'image/bmp'  => 'bmp',
2322                     'image/tiff' => 'tif',
2323                ) );
2324
2325                // Replace whatever is after the last period in the filename with the correct extension
2326                if ( ! empty( $mime_to_ext[ $real_mime ] ) ) {