FileTypes final class
Minn\Media\FileTypes · public/minn/src/Minn/Media/FileTypes.php · 75 lines
File types as WordPress knows them (data/mime.json): every extension's MIME type, the ones a user may upload, the kind each extension is (image, audio, document...), and the type a file name's extension says, each list through the filter plugins hook.
Constants and properties
| private | static ?array $table |
Public
| static | table(): array# | The table: mime (extensions => type), allowed (the ones uploads take by default) and ext2type (kind => extensions). @return array<string, mixed> |
| static | all(): mixed# | Every extension's MIME type (wp_get_mime_types), as mime_types leaves them. |
| static | allowed(mixed $user = NULL): mixed# | The types a user (the request's, unless one is given) may upload (get_allowed_mime_types): HTML and JavaScript too for one with unfiltered_html; then upload_mimes. |
| static | check(mixed $filename, mixed $mimes = NULL): array# | The extension and type a file name has among the types given (the allowed ones by default), false for each when none matches (wp_check_filetype). @return array{ext: string|false, type: mixed} |
| static | kinds(): mixed# | The extensions of each kind (wp_get_ext_types), as ext2type leaves them. |
| static | kindOf(mixed $ext): mixed# | The kind an extension is (wp_ext2type), or null. |
Nothing matches.