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

package Media Library Assistant
since 1.20

 Methods

Initialization function, similar to __construct()

initialize() : void

since 1.20

Adjust ajax handler for Media Manager queries

mla_admin_init_ajax_action() : void

Replace 'query-attachments' with our own handler if the request is coming from the "Assistant" tab

since 1.20

Adds settings values to be passed to the Media Manager in /wp-includes/js/media-views.js.

mla_media_view_settings_filter(array $settings, object $post) : array

Declared public because it is a filter.

since 1.20

Parameters

$settings

array

associative array with setting => value pairs

$post

object

|| NULL current post object, if available

Returns

arrayupdated $settings array

Adds strings values to be passed to the Media Manager in /wp-includes/js/media-views.js.

mla_media_view_strings_filter(array $strings, object $post) : array

Declared public because it is a filter.

since 1.20

Parameters

$strings

array

associative array with string => value pairs

$post

object

|| NULL current post object, if available

Returns

arrayupdated $strings array

Prints the templates used in the MLA Media Manager enhancements.

mla_print_media_templates_action() : void

Declared public because it is an action.

since 1.20

Ajax handler for Media Manager queries

mla_query_attachments_action() : void

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

since 1.20

Enqueues the mla-media-modal-scripts.js file, adding it to the Media Manager scripts.

mla_wp_enqueue_media_action() : void

Declared public because it is an action.

since 1.20

Display a monthly dropdown for filtering items

_months_dropdown(string $post_type) : array

Adapted from /wp-admin/includes/class-wp-list-table.php function months_dropdown()

since 1.20

Parameters

$post_type

string

post_type, e.g., 'attachment'

Returns

array( value => label ) pairs

Extract value and text elements from Dropdown HTML option tags

_terms_options(string $markup) : array

since 1.20

Parameters

$markup

string

HTML markup for taxonomy terms dropdown