MLAModal_Ajax

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
static
since 2.20

Adjust ajax handler for Media Manager queries

mla_admin_init_action() : void
static

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( $form_fields,  $post) : array
static

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

Arguments

$form_fields

$post

Response

array

updated descriptors for the "compat-attachment-fields"

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

mla_fill_compat_fields_action() : void
static

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( $args) : array
static

Declared public because it is a filter.

since 1.71

Arguments

$args

Response

array

arguments for the get_media_item function (unchanged)

Ajax handler for Media Manager "Query Attachments" queries

mla_query_attachments_action() : void
static

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
static

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
static
since
var

( 'errors' => array of strings, 'in_modal => boolean )

Type(s)

array