Class MLA (Media Library Assistant) Modal Ajax contains handlers for the WordPress 3.5+ Media Manager

package Media Library Assistant
since 2.20

 Methods

Initialization function, similar to __construct()

initialize() : void

since 2.20

Adjust ajax handler for Media Manager queries

mla_admin_init_action() : void

Replace 'query-attachments' with our own handler if the request is coming from the "Assistant" tab. Clean up the 'save-attachment-compat' values, removing the taxonomy updates MLS already handled.

since 2.20

Add/change custom fields to the Edit Media screen and Modal Window

mla_attachment_fields_to_edit_filter(array $form_fields, object $post) : array

Called from /wp-admin/includes/media.php, function get_compat_media_markup(); If "get_media_item_args"['in_modal'] => false ) its the Edit Media screen. If "get_media_item_args"['in_modal'] => true ) its the Media Manager Modal Window. For the Modal Window, $form_fields contains all the "compat-attachment-fields" including the taxonomies, which we want to enhance. Declared public because it is a filter.

since 1.71

Parameters

$form_fields

array

descriptors for the "compat-attachment-fields"

$post

object

the post to be edited

Returns

arrayupdated descriptors for the "compat-attachment-fields"

Ajax handler for Media Manager "fill compat-attachment-fields" queries

mla_fill_compat_fields_action() : void

Prepares an array of (HTML) taxonomy meta boxes with attachment-specific values.

since 2.20

Saves the get_media_item_args array for the attachment_fields_to_edit filter

mla_get_media_item_args_filter(array $args) : array

Declared public because it is a filter.

since 1.71

Parameters

$args

array

arguments for the get_media_item function in /wp-admin/includes/media.php

Returns

arrayarguments for the get_media_item function (unchanged)

Ajax handler for Media Manager "Query Attachments" queries

mla_query_attachments_action() : void

Adapted from wp_ajax_query_attachments in /wp-admin/includes/ajax-actions.php

since 2.20

Ajax handler for Media Manager "update compat-attachment-fields" queries

mla_update_compat_fields_action() : void

Updates one (or more) supported taxonomy and returns updated checkbox or tag/term lists

since 2.20

 Properties

 

The get_media_item_args array

$media_item_args : array

since 1.71