$disable_mla_filtering
$disable_mla_filtering : boolean
Disable MIME filtering during option initialization
Class MLA (Media Library Assistant) MIME filters WordPress MIME Type functions and supports the Views and Uploads Settings tabs
mla_sanitize_mime_type_filter( $sanitized_mime_type, $raw_mime_type) : string
Sanitize a MIME type
Called from /wp-includes/formatting.php, function sanitize_mime_type(). Defined as public because it's a filter.
$sanitized_mime_type | ||
$raw_mime_type |
Updated sanitized MIME type
mla_ext2type_filter( $standard_types) : array
Update the file extension to icon type (e.g., xls => spreadsheet, doc => document) 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.
$standard_types |
The updated associations array.
mla_wp_check_filetype_and_ext_filter( $validate, $file, $filename, $mimes) : array
Attempts to determine the real file type of a file
Called from /wp-includes/functions.php, function wp_check_filetype_and_ext(). Defined as public because it's a filter.
$validate | ||
$file | ||
$filename | ||
$mimes |
Updated array( ext, type, proper_filename (string or false) )
mla_mime_types_filter( $mime_types) : array
Retrieve list of MIME types and file extensions; use this filter to add types
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.
$mime_types |
Updated MIME types
mla_upload_mimes_filter( $mime_types, $user = NULL) : array
Retrieve list of allowed MIME types and file extensions; use this filter to remove types
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.
$mime_types | ||
$user |
Updated allowed MIME types
mla_post_mime_types_filter( $post_mime_types) : array
Get default Post MIME Types
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.
$post_mime_types |
Updated allowed MIME types
mla_icon_dir_filter( $path) : string
Retrieve the icon directory for a MIME type
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.
$path |
Updated path to the icon directory, no trailing slash
mla_icon_dir_uri_filter( $uri) : string
Retrieve the icon directory URL for a MIME type
Called from /wp-includes/post.php, function wp_mime_type_icon(). Defined as public because it's a filter.
$uri |
Updated path to the icon directory URL, no trailing slash
mla_icon_dirs_filter( $path_uri_array) : array
Retrieve the icon (directory => URI) array for a MIME type
Called from /wp-includes/post.php, function wp_mime_type_icon(). Defined as public because it's a filter.
$path_uri_array |
Updated (path => URI) array
mla_wp_mime_type_icon_filter( $icon, $mime, $post_id) : array
Retrieve the icon for a MIME type
Called from /wp-includes/post.php, function wp_mime_type_icon(). Defined as public because it's a filter.
$icon | ||
$mime | ||
$post_id |
Updated URI to the MIME type icon
mla_prepare_view_query( $slug, $specification) : array
Convert a Library View/Post MIME Type specification to WP_Query parameters
Compatibility shim for MLACore::mla_prepare_view_query
$slug | ||
$specification |
post_mime_type specification or custom field query
mla_parse_view_specification( $specification) : array
Analyze a Library View/Post MIME Type specification, returning an array of the placeholders it contains
Compatibility shim for MLACore::mla_parse_view_specification
$specification |
( ['prefix'] => string, ['name'] => string, ['value'] => string, ['option'] => string, optional ['error'] => string )