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_icon_type_size()
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 |
---|
array
Query variables for a single object, including slug
array
Message(s) reflecting the results of the operationmla_add_upload_mime(array $request) : array
since | 1.40 |
---|
array
Query variables for a single object, including slug
array
Message(s) reflecting the results of the operationmla_count_optional_upload_items(array $request) : integer
since | 1.40 |
---|
array
Query variables, e.g., from $_REQUEST
integer
Number of MLA Upload MIME Type objectsmla_count_upload_items(array $request) : integer
since | 1.40 |
---|
array
Query variables, e.g., from $_REQUEST
integer
Number of MLA Upload MIME Type objectsmla_count_view_items(array $request) : integer
since | 1.40 |
---|
array
Query variables, e.g., from $_REQUEST
integer
Number of MLA post_mime_type objectsmla_delete_post_mime_type(string $slug) : array
since | 1.40 |
---|
string
MLA post_mime_type slug
array
Message(s) reflecting the results of the operationmla_delete_upload_mime(string $slug) : array
since | 1.40 |
---|
string
MLA Upload MIME Type slug
array
Message(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 |
---|
array
The type => ( extensions ) associations.
array
The updated associations array.mla_get_core_icon_type(string $extension) : string
since | 1.40 |
---|
string
file extension
string
icon 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 |
---|
string
Icon Type, e.g., audio, video, spreadsheet
array
( width, height ) optional image size, default (64, 64).
string
HTML img element or empty string on failure.mla_get_icon_type_size(string $icon_type) : array
since | 2.14 |
---|
string
Icon Type, e.g., audio, video, spreadsheet
array
( width, height )mla_get_optional_upload_mime(integer $ID) : mixed
since | 1.40 |
---|
integer
MLA Optional Upload MIME Type ID
mixed
the requested object; false if object not foundmla_get_post_mime_type(string $slug) : mixed
since | 1.40 |
---|
string
MLA post_mime_type slug
mixed
Array 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 |
---|
integer
MLA post_mime_type post_ID
mixed
string with slug of the requested object; false if object not foundmla_get_upload_mime(string $slug) : mixed
since | 1.40 |
---|
string
MLA Upload MIME Type slug
mixed
Array of elements, including slug, for the requested object; false if object not foundmla_get_upload_mime_slug(integer $post_ID) : mixed
since | 1.40 |
---|
integer
MLA Upload MIME Type post_ID
mixed
string 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 |
---|
string
Path to the icon directory
string
Updated 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 |
---|
string
Path to the icon directory URL
string
Updated 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 |
---|
array
Path(s) and URI(s) to the icon directories
array
Updated (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 |
---|
array
Mime types keyed by the file extension regex corresponding to those types
array
Updated MIME typesmla_parse_view_specification(string | array $specification) : array
Compatibility shim for MLACore::mla_parse_view_specification
since | 1.40 |
---|
stringarray
A 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 |
---|
array
table 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 |
---|
array
Content 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')),
array
Updated allowed MIME typesmla_prepare_view_query(string $slug, string $specification) : array
Compatibility shim for MLACore::mla_prepare_view_query
since | 1.40 |
---|
string
View slug, unique identifier
string
A specification, e.g., "custom:Field,null" or "audio,application/vnd.ms"
array
post_mime_type specification or custom field querymla_query_optional_upload_items(array $request, int $offset, int $count) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
int
number of rows to skip over to reach desired page
int
number of rows on each page
array
MLA Upload MIME Type objectsmla_query_upload_items(array $request, int $offset, int $count) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
int
number of rows to skip over to reach desired page
int
number of rows on each page
array
MLA Upload MIME Type objectsmla_query_view_items(array $request, int $offset, int $count) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
int
number of rows to skip over to reach desired page
int
number of rows on each page
array
MLA 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 |
---|
string
Sanitized MIME type
string
Raw MIME type
string
Updated sanitized MIME typemla_tabulate_upload_items(string $s) : array
since | 1.40 |
---|
string
keyword search criterion, optional
array
( 'singular' label, 'plural' label, 'count' of items )mla_update_post_mime_type(array $request) : array
since | 1.40 |
---|
array
Query variables for new object values, including optional original_slug
array
Message(s) reflecting the results of the operationmla_update_upload_mime(array $request) : array
since | 1.40 |
---|
array
Query variables for new object values, including optional original_slug
array
Message(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 |
---|
array
Mime types keyed by the file extension regex corresponding to those types
mixed
User ID (integer) or object for checking against 'unfiltered_html' capability
array
Updated 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 |
---|
array
array( ext, type, proper_filename (string or false) )
string
Full path to the image
string
The filename of the image
array
Optional array of MIME types
array
Updated 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 |
---|
string
URI to the MIME type icon
string
MIME type represented by the icon
integer
Attachment ID or zero (0) if MIME type passed in
array
Updated URI to the MIME type icon_execute_optional_upload_items_query(array $request) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
array
query results; array of MLA Optional Upload MIME Type objects_execute_upload_items_query(array $request) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
array
query results; array of MLA Upload MIME Type objects_execute_view_items_query(array $request) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
array
query results; array of MLA post_mime_type objects_get_core_icon_types() : boolean
since | 1.40 |
---|
boolean
Success (true) or failure (false) of the operation_get_current_icon_types() : boolean
since | 1.40 |
---|
boolean
Success (true) or failure (false) of the operation_get_optional_upload_mime_templates() : boolean
since | 1.40 |
---|
boolean
Success (true) or failure (false) of the operation_get_post_mime_templates(boolean $force_refresh) : boolean
since | 1.40 |
---|
boolean
Force a reload/recalculation of types
boolean
Success (true) or failure (false) of the operation_get_upload_mime_templates(boolean $force_refresh) : boolean
since | 1.40 |
---|
boolean
Force a reload/recalculation of types
boolean
Success (true) or failure (false) of the operation_prepare_optional_upload_items_query(array $raw_request, int $offset, int $count) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
int
Optional number of rows (default 0) to skip over to reach desired page
int
Optional number of rows on each page (0 = all rows, default)
array
revised arguments suitable for query_prepare_upload_items_query(array $raw_request, int $offset, int $count) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
int
Optional number of rows (default 0) to skip over to reach desired page
int
Optional number of rows on each page (0 = all rows, default)
array
revised arguments suitable for query_prepare_view_items_query(array $raw_request, int $offset, int $count) : array
since | 1.40 |
---|
array
query parameters from web page, usually found in $_REQUEST
int
Optional number of rows (default 0) to skip over to reach desired page
int
Optional number of rows on each page (0 = all rows, default)
array
revised arguments suitable for query_put_post_mime_templates() : boolean
since | 1.40 |
---|
boolean
Success (true) or failure (false) of the operation_put_upload_mime_templates() : boolean
since | 1.40 |
---|
boolean
Success (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 |
---|