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
2650       *
2651       * @param array       $wp_check_filetype_and_ext File data array containing 'ext', 'type', and
2652       *                                               'proper_filename' keys.
2653       * @param string      $file                      Full path to the file.
2654       * @param string      $filename                  The name of the file (may differ from $file due to
2655       *                                               $file being in a tmp directory).
2656       * @param array       $mimes                     Key is the file extension with value as the mime type.
2657       * @param string|bool $real_mime                 The actual mime type or false if the type cannot be determined.
2658       */
2659      return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes, $real_mime );
2660 }
2661
2662 /**
2663  * Returns the real mime type of an image file.
2664  *
2665  * This depends on exif_imagetype() or getimagesize() to determine real mime types.
2666  *
2667  * @since 4.7.1
2668  *