Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu

Extends the core WP_List_Table class.

package Media Library Assistant
since 0.1

 Methods

Initializes some properties from $_REQUEST vairables, then calls the parent constructor to set some default configs.

__construct() : void

since 0.1

Supply the content for a custom column

column_ID_parent(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_alt_text(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_attached_to(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_author(array $item) : string

since 0.30

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_base_file(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_caption(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Displays checkboxes for using bulk actions.

column_cb(array $item) : string

The 'cb' column is given special treatment when columns are processed.

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_date(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply a column value if no column-specific function has been defined

column_default(array $item, array $column_name) : string

Called when the parent class can't find a method specifically built for a given column. The taxonomy columns are handled here. All other columns should have a specific method, so this function returns a troubleshooting message.

since 0.1

Parameters

$item

array

A singular item (one full row's worth of data)

$column_name

array

The name/slug of the column to be processed

Returns

stringText or HTML to be placed inside the column

Supply the content for a custom column

column_description(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_galleries(array $item) : string

since 0.70

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_icon(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_inserted(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_menu_order(array $item) : string

since 0.60

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_mla_galleries(array $item) : string

since 0.70

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_modified(array $item) : string

since 0.30

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_parent(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_post_mime_type(array $item) : string

since 0.30

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_post_name(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_post_title(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Supply the content for a custom column

column_title_name(array $item) : string

since 0.1

Parameters

$item

array

A singular attachment (post) object

Returns

stringHTML markup to be placed inside the column

Extra controls to be displayed between bulk actions and pagination

extra_tablenav(string $which) : array

Modeled after class-wp-posts-list-table.php in wp-admin/includes.

since 0.1

Parameters

$which

string

'top' or 'bottom', i.e., above or below the table rows

Returns

arrayContains all the bulk actions: 'slugs'=>'Visible Titles'

Get an associative array ( option_name => option_title ) with the list of bulk actions available on this table.

get_bulk_actions() : array

since 0.1

Returns

arrayContains all the bulk actions: 'slugs'=>'Visible Titles'

This method dictates the table's columns and titles

get_columns() : array

since 0.1

Returns

arrayColumn information: 'slugs'=>'Visible Titles'

Returns the list of currently hidden columns from a user option or from default values if the option is not set

get_hidden_columns() : array

since 0.1

Returns

arrayColumn information,e.g., array(0 => 'ID_parent, 1 => 'title_name')

Returns an array where the key is the column that needs to be sortable and the value is db column to sort by.

get_sortable_columns() : array

Also notes the current sort column, if set.

since 0.1

Returns

arraySortable column information,e.g., 'slugs'=>array('data_values',boolean)

Returns an associative array listing all the views that can be used with this table.

get_views() : array

These are listed across the top of the page and managed by WordPress.

since 0.1

Returns

arrayView information,e.g., array ( id => link )

Adds support for taxonomy columns

mla_admin_init_action() : void

Called in the admin_init action because the list_table object isn't created in time to affect the "screen options" setup.

since 0.30

Get possible mime types for view preparation

mla_get_attachment_mime_types() : array

Modeled after get_post_mime_types in wp-includes/post.php, with additional entries.

since 0.1

Returns

arrayMime type names and HTML markup for views

Return the names and display values of the sortable columns

mla_get_sortable_columns() : array

since 0.30

Returns

arrayname => array( orderby value, heading ) for sortable columns

Get dropdown box of terms to filter by, if available

mla_get_taxonomy_filter_dropdown(integer $selected) : string

since 1.20

Parameters

$selected

integer

currently selected term_id || zero (default)

Returns

stringHTML markup for dropdown box

Handler for filter 'manage_media_page_mla-menu_columns'

mla_manage_columns_filter() : array

This required filter dictates the table's columns and titles. Set when the file is loaded because the list_table object isn't created in time to affect the "screen options" setup.

since 0.1

Returns

arraylist of table columns

Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'

mla_manage_hidden_columns_filter(string $result, string $option, object $user_data) : array

Required because the screen.php get_hidden_columns function only uses the get_user_option result. Set when the file is loaded because the object is not created in time for the call from screen.php.

since 0.1

Parameters

$result

string

current list of hidden columns, if any

$option

string

'managemedia_page_mla-menucolumnshidden'

$user_data

object

WP_User object, if logged in

Returns

arrayupdated list of hidden columns

Prepares the list of items for displaying

prepare_items() : void

This is where you prepare your data for display. This method will usually be used to query the database, sort and filter the data, and generally get it ready to be displayed. At a minimum, we should set $this->items and $this->set_pagination_args().

since 0.1

Generates (echoes) content for a single row of the table

single_row(object $item) : void

since .20

Parameters

$item

object

the current item

Get mime types with one or more attachments for view preparation

_avail_mime_types(array $num_posts) : array

Modeled after get_available_post_mime_types in wp-admin/includes/post.php, with additional entries.

since 0.1

Parameters

$num_posts

array

Number of posts for each mime type

Returns

arrayMime type names

Add hidden fields with the data for use in the inline editor

_build_inline_data(object $item) : string

since 0.20

Parameters

$item

object

A singular attachment (post) object

Returns

stringHTML
with row data

Add rollover actions to exactly one of the following displayed columns: 'ID_parent', 'title_name', 'post_title', 'post_name'

_build_rollover_actions(object $item, string $column) : array

since 0.1

Parameters

$item

object

A singular attachment (post) object

$column

string

Current column name

Returns

arrayNames and URLs of row-level actions

Access the default list of hidden columns

_default_hidden_columns() : array

since 0.1

Returns

arraydefault list of hidden columns

 Properties

 

Currently hidden columns

$currently_hidden : array

Records hidden columns so row-level actions are not assigned to them.

since 0.1
 

Table column definitions

$default_columns : array

This array defines table columns and titles where the key is the column slug (and class) and the value is the column's title text. If you need a checkbox for bulk actions, use the special slug "cb".

The 'cb' column is treated differently than the rest. If including a checkbox column in your table you must create a column_cb() method. If you don't need bulk actions or checkboxes, simply leave the 'cb' entry out of your array.

Taxonomy columns are added to this array by mla_admin_init_action. Custom field columns are added to this array by mla_admin_init_action.

since 0.1
 

Default values for hidden columns

$default_hidden_columns : array

This array is used when the user-level option is not set, i.e., the user has not altered the selection of hidden columns.

The value on the right-hand side must match the column slug, e.g., array(0 => 'ID_parent, 1 => 'title_name').

Taxonomy columns are added to this array by mla_admin_init_action. Custom field columns are added to this array by mla_admin_init_action.

since 0.1
 

Sortable column definitions

$default_sortable_columns : array

This array defines the table columns that can be sorted. The array key is the column slug that needs to be sortable, and the value is database column to sort by. Often, the key and value will be the same, but this is not always the case (as the value is a column name from the database, not the list table).

The array value also contains a boolean which is 'true' if the data is currently sorted by that column. This is computed each time the table is displayed.

Taxonomy columns, if any, are added to this array by mla_admin_init_action. Custom field columns are added to this array by mla_admin_init_action.

since 0.1
 

Records assignment of row-level actions to a table row

$rollover_id : int

Set to the current Post-ID when row-level actions are output for the row.

since 0.1