initialize()
mla_add_post_mime_type()
mla_add_upload_mime()
mla_count_optional_upload_items()
mla_count_upload_items()
mla_count_view_items()
mla_delete_post_mime_type()
mla_delete_upload_mime()
mla_ext2type_filter()
mla_get_core_icon_type()
mla_get_current_icon_types()
mla_get_icon_type_image()
mla_get_optional_upload_mime()
mla_get_post_mime_type()
mla_get_post_mime_type_slug()
mla_get_upload_mime()
mla_get_upload_mime_slug()
mla_icon_dir_filter()
mla_icon_dir_uri_filter()
mla_icon_dirs_filter()
mla_mime_types_filter()
mla_parse_view_specification()
mla_pluck_table_views()
mla_post_mime_types_filter()
mla_prepare_view_query()
mla_query_optional_upload_items()
mla_query_upload_items()
mla_query_view_items()
mla_sanitize_mime_type_filter()
mla_tabulate_upload_items()
mla_update_post_mime_type()
mla_update_upload_mime()
mla_upload_mimes_filter()
mla_wp_check_filetype_and_ext_filter()
mla_wp_mime_type_icon_filter()
_execute_optional_upload_items_query()
_execute_upload_items_query()
_execute_view_items_query()
_get_core_icon_types()
_get_current_icon_types()
_get_optional_upload_mime_templates()
_get_post_mime_templates()
_get_upload_mime_templates()
_prepare_optional_upload_items_query()
_prepare_upload_items_query()
_prepare_view_items_query()
_put_post_mime_templates()
_put_upload_mime_templates()
$disable_mla_filtering
$mla_core_icon_types
$mla_current_icon_types
$mla_icon_type_associations
$mla_optional_upload_mime_templates
$mla_post_mime_highest_ID
$mla_post_mime_templates
$mla_upload_mime_descriptions
$mla_upload_mime_highest_ID
$mla_upload_mime_templates
Class MLA (Media Library Assistant) MIME filters WordPress MIME Type functions and supports the Views and Uploads Settings tabs
| package | Media Library Assistant |
|---|---|
| since | 1.40 |
initialize() : void
| since | 1.40 |
|---|
mla_add_post_mime_type(array $request) : array
| since | 1.40 |
|---|
arrayQuery variables for a single object, including slug
arrayMessage(s) reflecting the results of the operationmla_add_upload_mime(array $request) : array
| since | 1.40 |
|---|
arrayQuery variables for a single object, including slug
arrayMessage(s) reflecting the results of the operationmla_count_optional_upload_items(array $request) : integer
| since | 1.40 |
|---|
arrayQuery variables, e.g., from $_REQUEST
integerNumber of MLA Upload MIME Type objectsmla_count_upload_items(array $request) : integer
| since | 1.40 |
|---|
arrayQuery variables, e.g., from $_REQUEST
integerNumber of MLA Upload MIME Type objectsmla_count_view_items(array $request) : integer
| since | 1.40 |
|---|
arrayQuery variables, e.g., from $_REQUEST
integerNumber of MLA post_mime_type objectsmla_delete_post_mime_type(string $slug) : array
| since | 1.40 |
|---|
stringMLA post_mime_type slug
arrayMessage(s) reflecting the results of the operationmla_delete_upload_mime(string $slug) : array
| since | 1.40 |
|---|
stringMLA Upload MIME Type slug
arrayMessage(s) reflecting the results of the operationmla_ext2type_filter(array $standard_types) : array
Note that the calling function, wp_ext2type, takes an extension and returns an icon type. This filter updates the array of possible matches to support the calling function.
Called from /wp-includes/functions.php, function wp_ext2type(). That function is called from /wp-admin/includes/ajax-actions.php, function wp_ajax_send_link_to_editor(), /wp-admin/includes/media.php, function wp_media_upload_handler(), and /wp-includes/post.php, function wp_mime_type_icon(). The first two calls look for "audio" and "video" files to call the appropriate filter. The third call assigns the appropriate icon to the file for display purposes.
Defined as public because it's a filter.
| since | 1.40 |
|---|
arrayThe type => ( extensions ) associations.
arrayThe updated associations array.mla_get_core_icon_type(string $extension) : string
| since | 1.40 |
|---|
stringfile extension
stringicon type for the requested extension; 'default' if extension not foundmla_get_current_icon_types() : array
| since | 1.40 |
|---|
array( icon_type ) or false on failure.mla_get_icon_type_image(string $icon_type, array $size) : string
| since | 1.40 |
|---|
stringIcon Type, e.g., audio, video, spreadsheet
array( width, height ) optional image size, default (64, 64).
stringHTML img element or empty string on failure.mla_get_optional_upload_mime(integer $ID) : mixed
| since | 1.40 |
|---|
integerMLA Optional Upload MIME Type ID
mixedthe requested object; false if object not foundmla_get_post_mime_type(string $slug) : mixed
| since | 1.40 |
|---|
stringMLA post_mime_type slug
mixedArray of elements, including slug, for the requested object; false if object not foundmla_get_post_mime_type_slug(integer $post_ID) : mixed
| since | 1.40 |
|---|
integerMLA post_mime_type post_ID
mixedstring with slug of the requested object; false if object not foundmla_get_upload_mime(string $slug) : mixed
| since | 1.40 |
|---|
stringMLA Upload MIME Type slug
mixedArray of elements, including slug, for the requested object; false if object not foundmla_get_upload_mime_slug(integer $post_ID) : mixed
| since | 1.40 |
|---|
integerMLA Upload MIME Type post_ID
mixedstring with slug of the requested object; false if object not foundmla_icon_dir_filter(string $path) : string
Called from /wp-includes/deprecated.php, function get_attachment_icon_src(). Called from /wp-includes/media.php, function wp_get_attachment_image_src(). Called from /wp-includes/post.php, function wp_mime_type_icon(). Defined as public because it's a filter.
| since | 1.40 |
|---|
stringPath to the icon directory
stringUpdated path to the icon directory, no trailing slashmla_icon_dir_uri_filter(string $uri) : string
Called from /wp-includes/post.php, function wp_mime_type_icon(). Defined as public because it's a filter.
| since | 1.40 |
|---|
stringPath to the icon directory URL
stringUpdated path to the icon directory URL, no trailing slashmla_icon_dirs_filter(array $path_uri_array) : array
Called from /wp-includes/post.php, function wp_mime_type_icon(). Defined as public because it's a filter.
| since | 1.40 |
|---|
arrayPath(s) and URI(s) to the icon directories
arrayUpdated (path => URI) arraymla_mime_types_filter(array $mime_types) : array
Called from /wp-includes/functions.php, function wp_get_mime_types(). That function is called from /wp-includes/class-wp-image-editor.php functions get_mime_type() and get_extension(), and from /wp-includes/functions.php, functions do_enclose() and get_allowed_mime_types().
Defined as public because it's a filter.
| since | 1.40 |
|---|
arrayMime types keyed by the file extension regex corresponding to those types
arrayUpdated MIME typesmla_parse_view_specification(string $specification) : array
| since | 1.40 |
|---|
stringA specification, e.g., "custom:Field,null" or "audio,application/vnd.ms"
array( ['prefix'] => string, ['name'] => string, ['value'] => string, ['option'] => string, optional ['error'] => string )mla_pluck_table_views() : array
| since | 1.40 |
|---|
arraytable views array ( specification => Plural Label )mla_post_mime_types_filter(array $post_mime_types) : array
Called from /wp-includes/post.php, function get_post_mime_types(). That function is called from: /wp-admin/includes/media.php function get_media_item(), to validate the type of an attachment when it is edited, /wp-admin/includes/post.php, function wp_edit_attachments_query() to count the number of attachments of each type, and /wp-includes/media.php function wp_enqueue_media(), to populate the the Media Manager/Add Media "media items" drop down list.
Defined as public because it's a filter.
| since | 1.40 |
|---|
arrayContent types (image, audio, video) and presentation strings, e.g. 'image' => array(__('Images', 'media-library-assistant'), __('Manage Images', 'media-library-assistant'), _n_noop('Image (%s)', 'Images (%s)', 'media-library-assistant')),
arrayUpdated allowed MIME typesmla_prepare_view_query(string $slug, string $specification) : array
| since | 1.40 |
|---|
stringView slug, unique identifier
stringA specification, e.g., "custom:Field,null" or "audio,application/vnd.ms"
arraypost_mime_type specification or custom field querymla_query_optional_upload_items(array $request, int $offset, int $count) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
intnumber of rows to skip over to reach desired page
intnumber of rows on each page
arrayMLA Upload MIME Type objectsmla_query_upload_items(array $request, int $offset, int $count) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
intnumber of rows to skip over to reach desired page
intnumber of rows on each page
arrayMLA Upload MIME Type objectsmla_query_view_items(array $request, int $offset, int $count) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
intnumber of rows to skip over to reach desired page
intnumber of rows on each page
arrayMLA post_mime_type objectsmla_sanitize_mime_type_filter(string $sanitized_mime_type, string $raw_mime_type) : string
Called from /wp-includes/formatting.php, function sanitize_mime_type(). Defined as public because it's a filter.
| since | 1.40 |
|---|
stringSanitized MIME type
stringRaw MIME type
stringUpdated sanitized MIME typemla_tabulate_upload_items(string $s) : array
| since | 1.40 |
|---|
stringkeyword search criterion, optional
array( 'singular' label, 'plural' label, 'count' of items )mla_update_post_mime_type(array $request) : array
| since | 1.40 |
|---|
arrayQuery variables for new object values, including optional original_slug
arrayMessage(s) reflecting the results of the operationmla_update_upload_mime(array $request) : array
| since | 1.40 |
|---|
arrayQuery variables for new object values, including optional original_slug
arrayMessage(s) reflecting the results of the operationmla_upload_mimes_filter(array $mime_types, mixed $user) : array
Called from /wp-includes/functions.php, function get_allowed_mime_types(). That function is called from /wp-includes/formatting.php function sanitize_file_name() and from /wp-includes/functions.php, function wp_check_filetype(). wp_check_filetype returns only one MIME type for a given file extension, so the file extension should/must be a unique key.
This filter is also hooked by /wp-includes/ms-functions.php and processed in function check_upload_mimes(), which "is used to filter that list against the filetype whitelist provided by Multisite Super Admins at wp-admin/network/settings.php." Multisite installs must respect this restriction, so any list we produce will be passed thru that function if it exists.
This function is defined as public because it's a filter.
| since | 1.40 |
|---|
arrayMime types keyed by the file extension regex corresponding to those types
mixedUser ID (integer) or object for checking against 'unfiltered_html' capability
arrayUpdated allowed MIME typesmla_wp_check_filetype_and_ext_filter(array $validate, string $file, string $filename, array $mimes) : array
Called from /wp-includes/functions.php, function wp_check_filetype_and_ext(). Defined as public because it's a filter.
| since | 1.40 |
|---|
arrayarray( ext, type, proper_filename (string or false) )
stringFull path to the image
stringThe filename of the image
arrayOptional array of MIME types
arrayUpdated array( ext, type, proper_filename (string or false) )mla_wp_mime_type_icon_filter(string $icon, string $mime, integer $post_id) : array
Called from /wp-includes/post.php, function wp_mime_type_icon(). Defined as public because it's a filter.
| since | 1.40 |
|---|
stringURI to the MIME type icon
stringMIME type represented by the icon
integerAttachment ID or zero (0) if MIME type passed in
arrayUpdated (path => URI) array_execute_optional_upload_items_query(array $request) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
arrayquery results; array of MLA Optional Upload MIME Type objects_execute_upload_items_query(array $request) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
arrayquery results; array of MLA Upload MIME Type objects_execute_view_items_query(array $request) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
arrayquery results; array of MLA post_mime_type objects_get_core_icon_types() : boolean
| since | 1.40 |
|---|
booleanSuccess (true) or failure (false) of the operation_get_current_icon_types() : boolean
| since | 1.40 |
|---|
booleanSuccess (true) or failure (false) of the operation_get_optional_upload_mime_templates() : boolean
| since | 1.40 |
|---|
booleanSuccess (true) or failure (false) of the operation_get_post_mime_templates(boolean $force_refresh) : boolean
| since | 1.40 |
|---|
booleanForce a reload/recalculation of types
booleanSuccess (true) or failure (false) of the operation_get_upload_mime_templates(boolean $force_refresh) : boolean
| since | 1.40 |
|---|
booleanForce a reload/recalculation of types
booleanSuccess (true) or failure (false) of the operation_prepare_optional_upload_items_query(array $raw_request, int $offset, int $count) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
intOptional number of rows (default 0) to skip over to reach desired page
intOptional number of rows on each page (0 = all rows, default)
arrayrevised arguments suitable for query_prepare_upload_items_query(array $raw_request, int $offset, int $count) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
intOptional number of rows (default 0) to skip over to reach desired page
intOptional number of rows on each page (0 = all rows, default)
arrayrevised arguments suitable for query_prepare_view_items_query(array $raw_request, int $offset, int $count) : array
| since | 1.40 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
intOptional number of rows (default 0) to skip over to reach desired page
intOptional number of rows on each page (0 = all rows, default)
arrayrevised arguments suitable for query_put_post_mime_templates() : boolean
| since | 1.40 |
|---|
booleanSuccess (true) or failure (false) of the operation_put_upload_mime_templates() : boolean
| since | 1.40 |
|---|
booleanSuccess (true) or failure (false) of the operation$disable_mla_filtering : boolean
| since | 1.40 |
|---|
$mla_core_icon_types : array
| since | 1.40 |
|---|
$mla_current_icon_types : array
| since | 1.40 |
|---|
$mla_icon_type_associations : array
| since | 1.40 |
|---|
$mla_optional_upload_mime_templates : array
| since | 1.40 |
|---|
$mla_post_mime_highest_ID : integer
| since | 1.40 |
|---|
$mla_post_mime_templates : array
| since | 1.40 |
|---|
$mla_upload_mime_descriptions : array
| since | 1.80 |
|---|
$mla_upload_mime_highest_ID : integer
| since | 1.40 |
|---|
$mla_upload_mime_templates : array
| since | 1.40 |
|---|