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
2044       * @since 3.0.0
2045       *
2046       * @param array  $wp_check_filetype_and_ext File data array containing 'ext', 'type', and
2047       *                                          'proper_filename' keys.
2048       * @param string $file                      Full path to the file.
2049       * @param string $filename                  The name of the file (may differ from $file due to
2050       *                                          $file being in a tmp directory).
2051       * @param array  $mimes                     Key is the file extension with value as the mime type.
2052       */
2053      return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes );
2054 }
2055
2056 /**
2057  * Retrieve list of mime types and file extensions.
2058  *
2059  * @since 3.5.0
2060  *
2061  * @return array Array of mime types keyed by the file extension regex corresponding to those types.
2062  */