Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_check_filetype_and_ext

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
3234       *     @type string|false $type            File mime type, or false if the file doesn't match a mime type.
3235       *     @type string|false $proper_filename File name with its correct extension, or false if it cannot be determined.
3236       * }
3237       * @param string       $file                      Full path to the file.
3238       * @param string       $filename                  The name of the file (may differ from $file due to
3239       *                                                $file being in a tmp directory).
3240       * @param string[]     $mimes                     Array of mime types keyed by their file extension regex.
3241       * @param string|false $real_mime                 The actual mime type or false if the type cannot be determined.
3242       */
3243      return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes, $real_mime );
3244 }
3245
3246 /**
3247  * Returns the real mime type of an image file.
3248  *
3249  * This depends on exif_imagetype() or getimagesize() to determine real mime types.
3250  *
3251  * @since 4.7.1
3252  * @since 5.8.0 Added support for WebP images.