Filters the list of allowed mime types and file extensions.
Parameters
$t
array- Mime types keyed by the file extension regex corresponding to those types.
$user
int|WP_User|null- User ID, User object or null if not provided (indicates current user).
Source
return apply_filters( 'upload_mimes', $t, $user );
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |
Add MIME types.
And if you want to know what is your real file mime type, you can use this service: https://wp-check-mime-type.com/.
(example taken from @dotmastaz’s feedback)
Allow SVGZ mime type:
And if you want to know what is your real file mime type, you can use this service: https://wp-check-mime-type.com/.
Filter the upload mime types to allow JSON files.
Allow CSV file type.
Allow uploading fonts files.
If you work locally, for example on XAMPP, you should also include extension=gd in php.ini, just uncomment it, removing ; in front of it.