Glossary Term
wp_check_filetype_and_ext()
wp_check_filetype_and_ext() — Attempts to determine the real file type of a file. If unable to, the file name extension will be used to determine type. If it’s determined that the extension does not match the file’s real type, then the “proper_filename” value will be set with a proper filename and extension. Currently this function only supports renaming images validated via wp_get_image_mime().
Inputs: $file (string): Full path to the file. $filename (string): The name of the file (may differ from $file due to $file being in a tmp directory). $mimes (string[]|null): 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, mime type, and corrected filename. Field $ext (string|false): File extension, or false if the file doesn’t match a mime type. Field $type (string|false): File mime type, or false if the file doesn’t match a mime type. Field $proper_filename (string|false): File name with its correct extension, or false if it cannot be determined.
Term Connections
Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.
Loading term connections…
