Class MLA (Media Library Assistant) provides several enhancements to the handling of images and files held in the WordPress Media Library.

package Media Library Assistant
since 0.1

 Methods

Initialization function, similar to __construct()

initialize() 

since 0.1

Add contextual help tabs to all the MLA pages

mla_add_help_tab() 

since 0.1

Add the "XX Entries per page" filter to the Screen Options tab

mla_add_menu_options() 

since 0.1

Load the plugin's Style Sheet and Javascript files

mla_admin_enqueue_scripts_action(string $page_hook) : \nothing

since 0.1

Parameters

$page_hook

string

Name of the page being loaded

Returns

\nothing

Add the submenu pages

mla_admin_menu_action() 

Add a submenu page in the "Media" section, add submenu page(s) for attachment taxonomies, add filter to clean up taxonomy submenu labels add settings page in the "Settings" section, add settings link in the Plugins section entry for MLA.

since 0.1

Redirect to the Edit Tags/Categories page

mla_edit_tags_redirect() 

The custom taxonomy add/edit submenu entries go to "upload.php" by default. This filter is the only way to redirect them to the correct WordPress page.

since 0.1

Cleanup menus for Edit Tags/Categories page

mla_modify_parent_menu(array $parent_file) : string

The submenu entries for custom taxonomies under the "Media" menu are not set up correctly by WordPress, so this function cleans them up, redirecting the request to the right WordPress page for editing/adding taxonomy terms.

since 0.1

Parameters

$parent_file

array

The top-level menu page

Returns

stringThe updated top-level menu page

Render the "Assistant" subpage in the Media section, using the list_table package

mla_render_admin_page() 

since 0.1

Only show screen options on the table-list screen

mla_screen_options_show_screen_filter(boolean $show_screen, string $this_screen) : boolean

since 0.1

Parameters

$show_screen

boolean

True to display "Screen Options", false to suppress them

$this_screen

string

Name of the page being loaded

Returns

booleanTrue to display "Screen Options", false to suppress them

Save the "Entries per page" option set by this user

mla_set_screen_option_filter(boolean $status, string $option, string $value) : string

since 0.1

Parameters

$status

boolean

Unknown - always false?

$option

string

Name of the option being changed

$value

string

New value of the option

Returns

stringNew value if this is our option, otherwise nothing

Get the current action selected from the bulk actions dropdown.

_current_bulk_action() : string | bool

since 0.1

Returns

stringboolThe action name or False if no action was selected

Delete a single item permanently.

_delete_single_item(array $post_id) : array

since 0.1

Parameters

$post_id

array

The form POST data.

Returns

arraysuccess/failure message and null content

Display a single item sub page; prepare the form to change the meta data for a single attachment.

_display_single_item(int $post_id) : array

since 0.1

Parameters

$post_id

int

The WordPress Post ID of the attachment item

Returns

arraymessage and/or HTML content.

Restore a single item from the Trash

_restore_single_item(array $post_id) : array

since 0.1

Parameters

$post_id

array

The form POST data

Returns

arraysuccess/failure message and null content

Move a single item to Trash

_trash_single_item(array $post_id) : array

since 0.1

Parameters

$post_id

array

The form POST data

Returns

arraysuccess/failure message and null content

Update a single item; change the meta data for a single attachment.

_update_single_item(int $post_id, array $new_data, array $tax_input) : array

since 0.1

Parameters

$post_id

int

The ID of the attachment to be updated

$new_data

array

Field name => value pairs

$tax_input

array

Attachment Category and Tag values

Returns

arraysuccess/failure message and null content

 Properties

 

Holds screen ids to match help text to corresponding screen

$page_hooks : array

since 0.1

 Constants

 

Slug for adding plugin submenu

ADMIN_PAGE_SLUG : string

since 0.1
 

Current version number

CURRENT_MLA_VERSION : string

since 0.1
 

Slug for localizing and enqueueing plugin JavaScript

JAVASCRIPT_SLUG : string

since 0.1
 

Minimum version of PHP required for this plugin

MIN_PHP_VERSION : string

since 0.1
 

Minimum version of WordPress required for this plugin

MIN_WORDPRESS_VERSION : string

since 0.1
 

Action name; uniquely identifies the nonce

MLA_ADMIN_NONCE : string

since 0.1
 

mla_admin_action value for permanently deleting a single item

MLA_ADMIN_SINGLE_DELETE : string

since 0.1
 

mla_admin_action value for displaying a single item

MLA_ADMIN_SINGLE_EDIT_DISPLAY : string

since 0.1
 

mla_admin_action value for updating a single item

MLA_ADMIN_SINGLE_EDIT_UPDATE : string

since 0.1
 

mla_admin_action value for restoring a single item from the trash

MLA_ADMIN_SINGLE_RESTORE : string

since 0.1
 

mla_admin_action value for moving a single item to the trash

MLA_ADMIN_SINGLE_TRASH : string

since 0.1
 

Display name for this plugin

PLUGIN_NAME : string

since 0.1
 

Slug for registering and enqueueing plugin style sheet

STYLESHEET_SLUG : string

since 0.1