wp_check_filetype
wp_check_filetype ( $filename, $mimes = null )
Parameters:- (string) filename File name or path.
- (string[]|null) mimes Optional. Array of allowed mime types keyed by their file extension regex. Defaults to the result of get_allowed_mime_types().
Returns:- (array) { Values for the extension and mime type. @type string|false $ext File extension, or false if the file doesn't match a mime type. @type string|false $type File mime type, or false if the file doesn't match a mime type. }
Defined at: - Introduced in WordPress: 2.0.4
- Deprecated in WordPress: —
Description
Retrieves the file type from the file name.You can optionally define the mime array, if needed.