# MLA_List_Table

Extends \WP_List_Table

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 variables, then calls the parent constructor to set some default configs.

    __construct()

since | 0.1

## Get MIME types with one or more attachments for view preparation

    _avail_mime_types( $num_posts) : array

static

Modeled after get_available_post_mime_types in wp-admin/includes/post.php, but uses the output of wp_count_attachments() as input.

since | 0.1

### Arguments

#### $num_posts

``

### Response

`array`

Mime type names

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

    _build_inline_data( $item) : string

since | 0.20

### Arguments

#### $item

``

### Response

`string`

HTML

with row data

## Generate item thumbnail image tag

    _build_item_thumbnail( $item) : string

since | 2.15

### Arguments

#### $item

``

### Response

`string`

HTML for thumbnail

## Add rollover actions to the current primary column, one of: 'ID_parent', 'title_name', 'post_title', 'post_name'

    _build_rollover_actions( $item,  $column) : array

since | 0.1

### Arguments

#### $item

``

#### $column

``

### Response

`array`

Names and URLs of row-level actions

## Translate post_status 'future', 'pending', 'draft' and 'trash' to label

    _format_post_status( $post_status) : string

since | 2.01

### Arguments

#### $post_status

``

### Response

`string`

Status label or empty string

## Returns HTML markup for one view that can be used with this table

    _get_view( $view_slug,  $current_view) : string

static

since | 1.40

### Arguments

#### $view_slug

``

#### $current_view

``

### Response

`string`

| false HTML for link to display the view, false if count = zero

## Format primary column before/after Wordpress v4.3

    _handle_primary_column( $item,  $column_name,  $column_content) : string

For WordPress before 4.3, add rollover actions and inline_data to the first visible column. For 4.3 and later, merge the icon with the primary visible column and add div tags.

since | 2.13

### Arguments

#### $item

``

#### $column_name

``

#### $column_content

``

### Response

`string`

Complete column content

## Checks the current user's permissions

    ajax_user_can() : boolean

since | 2.13

### Response

`boolean`

## Supply the content for a custom column

    column_alt_text( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_attached_to( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_author( $item) : string

since | 0.30

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_base_file( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_caption( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Displays checkboxes for using bulk actions. The 'cb' column is given special treatment when columns are processed.

    column_cb( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_date( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

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

    column_default( $item,  $column_name) : string

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

since | 0.1

### Arguments

#### $item

``

#### $column_name

``

### Response

`string`

Text or HTML to be placed inside the column

## Supply the content for a custom column

    column_description( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_featured( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_file_url( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_galleries( $item) : string

since | 0.70

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_icon( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_ID_parent( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_inserted( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_mla_galleries( $item) : string

since | 0.70

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_modified( $item) : string

since | 0.30

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_parent( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_post_mime_type( $item) : string

since | 0.30

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_post_name( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_post_title( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Supply the content for a custom column

    column_title_name( $item) : string

since | 0.1

### Arguments

#### $item

``

### Response

`string`

HTML markup to be placed inside the column

## Generate the table navigation above or below the table

    display_tablenav( $which)

Adds the list/grid switcher in WP 4.0+

since | 2.25

### Arguments

#### $which

``

## Extra controls to be displayed between bulk actions and pagination

    extra_tablenav( $which) : void

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

since | 0.1

### Arguments

#### $which

``

## 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

### Response

`array`

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

## This method dictates the table's columns and titles

    get_columns() : array

since | 0.1

### Response

`array`

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

## Get the name of the default primary column.

    get_default_primary_column_name() : string

since | 2.13
access | protected

### Response

`string`

Name of the default primary column

## 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

### Response

`array`

Column 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 (or other criteria) to sort by.

    get_sortable_columns() : array

since | 0.1

### Response

`array`

Sortable column information,e.g., 'slug' => array('data_value', (boolean) initial_descending )

## 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

### Response

`array`

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

## Generate and display row actions links.

    handle_row_actions(object $item, string $column_name, string $primary) : string

since | 2.13
access | protected

### Arguments

#### $item

`object`

Attachment being acted upon.

#### $column_name

`string`

Current column name.

#### $primary

`string`

Primary column name.

### Response

`string`

Row actions output for media attachments.

## Adds support for taxonomy and custom field columns

    mla_admin_init_action()

static

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 dropdown box of custom field values to filter by, if available

    mla_get_custom_field_filter_dropdown( $selected = \MLACoreOptions::ALL_MLA_FILTER_METAKEY,  $dropdown_options = array()) : string

static

since | 2.32

### Arguments

#### $selected

``

#### $dropdown_options

``

### Response

`string`

HTML markup for dropdown box

## Get dropdown box of terms to filter by, if available

    mla_get_taxonomy_filter_dropdown( $selected,  $dropdown_options = array()) : string

static

since | 1.20

### Arguments

#### $selected

``

#### $dropdown_options

``

### Response

`string`

HTML markup for dropdown box

## Wrapper for _get_view; returns HTML markup for one view that can be used with this table

    mla_get_view( $view_slug,  $current_view) : string

since | 2.11

### Arguments

#### $view_slug

``

#### $current_view

``

### Response

`string`

| false HTML for link to display the view, false if count = zero

## Handler for filter 'manage_media_page_mla-menu_columns'

    mla_manage_columns_filter() : array

static

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

### Response

`array`

list of table columns

## Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'

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

static

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

### Arguments

#### $result

``

#### $option

``

#### $user_data

``

### Response

`array`

updated list of hidden columns

## Process $_REQUEST, building $submenu_arguments

    mla_submenu_arguments( $include_filters = true) : array

static

since | 1.42

### Arguments

#### $include_filters

``

### Response

`array`

non-empty view, search, filter and sort arguments

## Display the pagination, adding view, search and filter arguments

    pagination( $which)

since | 1.42

### Arguments

#### $which

``

## Prepares the list of items for displaying

    prepare_items()

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

## Print column headers, adding view, search and filter arguments

    print_column_headers(boolean $with_id = true)

since | 1.42

### Arguments

#### $with_id

`boolean`

Whether to set the id attribute or not

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

    single_row( $item) : void

since | .20

### Arguments

#### $item

``

### Properties

## True if the current view is "Unattached"

    detached : integer

Declaration added in MLA v2.11 for WP 4.2 compatibility.

since |
var |

### Type(s)

`integer`

## True if the current view is "Attached"

    attached : integer

since |
var |

### Type(s)

`integer`

## True if the current view is "Trash"

    is_trash : integer

Declaration added in MLA v2.11 for WP 4.2 compatibility.

since |
var |

### Type(s)

`integer`

## Records assignment of row-level actions to a table row

    rollover_id : integer

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

since |
var |

### Type(s)

`integer`

## Currently hidden columns

    currently_hidden : array

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

since |
var |

### Type(s)

`array`

## The WPML_List_table support object, if required

    mla_wpml_table : object

since |
var |

### Type(s)

`object`

## Table column definitions

    default_columns : array

static

since |
var |

### Type(s)

`array`

## Default values for hidden columns

    default_hidden_columns : array

static

since |
var |

### Type(s)

`array`

## Sortable column definitions

    default_sortable_columns : array

static

since |
var |

### Type(s)

`array`