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 |
_execute_optional_upload_items_query( $request) : array
| since | 1.40 |
|---|
arrayquery results; array of MLA Optional Upload MIME Type objects
_execute_upload_items_query( $request) : array
| since | 1.40 |
|---|
arrayquery results; array of MLA Upload MIME Type objects
_execute_view_items_query( $request) : array
| since | 1.40 |
|---|
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( $force_refresh = false) : boolean
| since | 1.40 |
|---|
booleanSuccess (true) or failure (false) of the operation
_get_sortable_upload_columns() : array
| since | 1.40 |
|---|---|
arrayname => array( orderby value, heading ) for sortable columns
_get_sortable_upload_optional_columns() : array
| since | 1.40 |
|---|---|
arrayname => array( orderby value, heading ) for sortable columns
_get_sortable_view_columns() : array
| since | 1.40 |
|---|---|
arrayname => array( orderby value, heading ) for sortable columns
_get_upload_mime_templates( $force_refresh = false) : boolean
| since | 1.40 |
|---|
booleanSuccess (true) or failure (false) of the operation
_localize_default_upload_columns() : void
| since | 1.71 |
|---|---|
_localize_default_upload_optional_columns() : void
| since | 1.71 |
|---|---|
_localize_default_view_columns() : void
| since | 1.71 |
|---|---|
_prepare_optional_upload_items_query( $raw_request, $offset, $count) : array
| since | 1.40 |
|---|
arrayrevised arguments suitable for query
_prepare_upload_items_query( $raw_request, $offset, $count) : array
| since | 1.40 |
|---|
arrayrevised arguments suitable for query
_prepare_view_items_query( $raw_request, $offset, $count) : array
| since | 1.40 |
|---|
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
initialize() : void
| since | 1.40 |
|---|---|
mla_add_post_mime_type( $request) : array
| since | 1.40 |
|---|
arrayMessage(s) reflecting the results of the operation
mla_add_upload_mime( $request) : array
| since | 1.40 |
|---|
arrayMessage(s) reflecting the results of the operation
mla_count_optional_upload_items( $request) : integer
| since | 1.40 |
|---|
integerNumber of MLA Upload MIME Type objects
mla_count_upload_items( $request) : integer
| since | 1.40 |
|---|
integerNumber of MLA Upload MIME Type objects
mla_count_view_items( $request) : integer
| since | 1.40 |
|---|
integerNumber of MLA post_mime_type objects
mla_delete_post_mime_type( $slug) : array
| since | 1.40 |
|---|
arrayMessage(s) reflecting the results of the operation
mla_delete_upload_mime( $slug) : array
| since | 1.40 |
|---|
arrayMessage(s) reflecting the results of the operation
mla_ext2type_filter( $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 updated associations array.
mla_get_core_icon_type( $extension) : string
| since | 1.40 |
|---|
stringicon type for the requested extension; 'default' if extension not found
mla_get_current_icon_types() : array
| since | 1.40 |
|---|---|
array( icon_type ) or false on failure.
mla_get_icon_type_image( $icon_type, $size = NULL) : string
| since | 1.40 |
|---|
stringHTML img element or empty string on failure.
mla_get_icon_type_size( $icon_type) : array
| since | 2.14 |
|---|
array( width, height )
mla_get_optional_upload_mime( $ID) : mixed
| since | 1.40 |
|---|
mixedthe requested object; false if object not found
mla_get_post_mime_type( $slug) : mixed
| since | 1.40 |
|---|
mixedArray of elements, including slug, for the requested object; false if object not found
mla_get_post_mime_type_slug( $post_ID) : mixed
| since | 1.40 |
|---|
mixedstring with slug of the requested object; false if object not found
mla_get_upload_mime( $slug) : mixed
| since | 1.40 |
|---|
mixedArray of elements, including slug, for the requested object; false if object not found
mla_get_upload_mime_slug( $post_ID) : mixed
| since | 1.40 |
|---|
mixedstring with slug of the requested object; false if object not found
mla_getimagesize_mimes_to_exts_filter(array $mime_to_ext)
Mitigates a bug in WP 4.6.x and 4.7.x that prevents uploading SVG files.
| since | 2.50 |
|---|---|
arrayArray of image mime types and their matching extensions.
mla_icon_dir_filter( $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 |
|---|
stringUpdated path to the icon directory, no trailing slash
mla_icon_dir_uri_filter( $uri) : string
Called from /wp-includes/post.php, function wp_mime_type_icon(). Defined as public because it's a filter.
| since | 1.40 |
|---|
stringUpdated path to the icon directory URL, no trailing slash
mla_icon_dirs_filter( $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 |
|---|
arrayUpdated (path => URI) array
mla_mime_types_filter( $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 |
|---|
arrayUpdated MIME types
mla_parse_view_specification( $specification) : array
Compatibility shim for MLACore::mla_parse_view_specification
| since | 1.40 |
|---|
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( $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 |
|---|
arrayUpdated allowed MIME types
mla_prepare_view_query( $slug, $specification) : array
Compatibility shim for MLACore::mla_prepare_view_query
| since | 1.40 |
|---|
arraypost_mime_type specification or custom field query
mla_query_optional_upload_items( $request, $offset, $count) : array
| since | 1.40 |
|---|
arrayMLA Upload MIME Type objects
mla_query_upload_items( $request, $offset, $count) : array
| since | 1.40 |
|---|
arrayMLA Upload MIME Type objects
mla_query_view_items( $request, $offset, $count) : array
| since | 1.40 |
|---|
arrayMLA post_mime_type objects
mla_sanitize_mime_type_filter( $sanitized_mime_type, $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 |
|---|
stringUpdated sanitized MIME type
mla_tabulate_upload_items( $s = '') : array
| since | 1.40 |
|---|
array( 'singular' label, 'plural' label, 'count' of items )
mla_update_post_mime_type( $request) : array
| since | 1.40 |
|---|
arrayMessage(s) reflecting the results of the operation
mla_update_upload_mime( $request = NULL) : array
| since | 1.40 |
|---|
arrayMessage(s) reflecting the results of the operation
mla_upload_mimes_filter( $mime_types, $user = NULL) : 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.
Defined as public because it's a filter.
| since | 1.40 |
|---|
arrayUpdated allowed MIME types
mla_wp_check_filetype_and_ext_filter( $validate, $file, $filename, $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 |
|---|
arrayUpdated array( ext, type, proper_filename (string or false) )
mla_wp_mime_type_icon_filter( $icon, $mime, $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 |
|---|
arrayUpdated URI to the MIME type icon
disable_mla_filtering : boolean
| since | |
|---|---|
| var |
boolean
mla_icon_type_associations : array
| since | |
|---|---|
| var |
slug => ( singular, plural, specification, post_mime_type, table_view, menu_order, description ) |
array
default_upload_columns : array
This array defines table columns and titles where the key is the column slug (and class) and the value is the column's title text.
All of the columns are added to this array by MLAMime::_localize_default_upload_columns.
| since | |
|---|---|
| var |
array
default_sortable_upload_columns : array
This array defines the table columns that can be sorted. The array key is the column slug that needs to be sortable, and the value is database column to sort by. Often, the key and value will be the same, but this is not always the case (as the value is a column name from the database, not the list table).
The array value also contains a boolean which is 'true' if the initial sort order for the column is DESC/Descending.
| since | |
|---|---|
| var |
array
default_upload_optional_columns : array
This array defines table columns and titles where the key is the column slug (and class) and the value is the column's title text.
All of the columns are added to this array by MLAMime::_localize_default_upload_optional_columns.
| since | |
|---|---|
| var |
array
default_upload_optional_sortable_columns : array
This array defines the table columns that can be sorted. The array key is the column slug that needs to be sortable, and the value is database column to sort by. Often, the key and value will be the same, but this is not always the case (as the value is a column name from the database, not the list table).
The array value also contains a boolean which is 'true' if the initial sort order for the column is DESC/Descending.
| since | |
|---|---|
| var |
array
default_view_columns : array
This array defines table columns and titles where the key is the column slug (and class) and the value is the column's title text.
All of the columns are added to this array by MLAMime::_localize_default_view_columns.
| since | |
|---|---|
| var |
array
default_sortable_view_columns : array
This array defines the table columns that can be sorted. The array key is the column slug that needs to be sortable, and the value is database column to sort by. Often, the key and value will be the same, but this is not always the case (as the value is a column name from the database, not the list table).
The array value also contains a boolean which is 'true' if the initial sort order for the column is DESC/Descending.
| since | |
|---|---|
| var |
array
mla_post_mime_templates : array
| since | |
|---|---|
| var |
slug => ( singular, plural, specification, post_mime_type, table_view, menu_order, description ) |
array
mla_post_mime_highest_ID : integer
| since | |
|---|---|
| var |
integer
mla_core_icon_types : array
| since | |
|---|---|
| var |
extension => ( core_icon_type ) |
array
mla_current_icon_types : array
| since | |
|---|---|
| var |
( icon_type => icon_image_uri ) |
array
mla_upload_mime_templates : array
| since | |
|---|---|
| var |
extension => ( post_ID, mime_type, core_type, mla_type, source, standard_source, disabled, description, icon_type, wp_icon_type, mla_icon_type, core_icon_type ) |
array
mla_upload_mime_descriptions : array
| since | |
|---|---|
| var |
extension => description |
array
mla_upload_mime_highest_ID : integer
| since | |
|---|---|
| var |
integer
mla_optional_upload_mime_templates : array
| since | |
|---|---|
| var |
( ID, slug, mime_type, core_type, mla_type, description ) |
array