Properties

$rollover_id

$rollover_id : integer

Records assignment of row-level actions to a table row

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

Type

integer

$currently_hidden

$currently_hidden : array

Currently hidden columns

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

Type

array

$mla_wpml_table

$mla_wpml_table : object

The WPML_List_table support object, if required

Type

object

$default_columns

$default_columns : array

Table column definitions

Type

array

$default_hidden_columns

$default_hidden_columns : array

Default values for hidden columns

Type

array

$default_sortable_columns

$default_sortable_columns : array

Sortable column definitions

Type

array

$detached

$detached : integer

True if the current view is "Unattached"

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

Type

integer

$attached

$attached : integer

True if the current view is "Attached"

Type

integer

$is_trash

$is_trash : integer

True if the current view is "Trash"

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

Type

integer

Methods

mla_get_custom_field_filter_dropdown()

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

Get dropdown box of custom field values to filter by, if available

Parameters

$selected
$dropdown_options

Returns

string —

HTML markup for dropdown box

mla_get_taxonomy_filter_dropdown()

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

Get dropdown box of terms to filter by, if available

Parameters

$selected
$dropdown_options

Returns

string —

HTML markup for dropdown box

mla_submenu_arguments()

mla_submenu_arguments(  $include_filters = true) : array

Process $_REQUEST, building $submenu_arguments

Parameters

$include_filters

Returns

array —

non-empty view, search, filter and sort arguments

mla_manage_hidden_columns_filter()

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

Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'

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.

Parameters

$result
$option
$user_data

Returns

array —

updated list of hidden columns

mla_manage_columns_filter()

mla_manage_columns_filter() : array

Handler for filter 'manage_media_page_mla-menu_columns'

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.

Returns

array —

list of table columns

mla_admin_init_action()

mla_admin_init_action() 

Adds support for taxonomy and custom field columns

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

__construct()

__construct() 

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

ajax_user_can()

ajax_user_can() : boolean

Checks the current user's permissions

Returns

boolean

column_default()

column_default(  $item,   $column_name) : string

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

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.

Parameters

$item
$column_name

Returns

string —

Text or HTML to be placed inside the column

column_cb()

column_cb(  $item) : string

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

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_icon()

column_icon(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_ID_parent()

column_ID_parent(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_title_name()

column_title_name(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_post_title()

column_post_title(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_post_name()

column_post_name(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_parent()

column_parent(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_menu_order()

column_menu_order(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_featured()

column_featured(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_inserted()

column_inserted(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_galleries()

column_galleries(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_mla_galleries()

column_mla_galleries(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_alt_text()

column_alt_text(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_caption()

column_caption(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_description()

column_description(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_post_mime_type()

column_post_mime_type(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_file_url()

column_file_url(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_base_file()

column_base_file(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_date()

column_date(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_modified()

column_modified(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_author()

column_author(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

column_attached_to()

column_attached_to(  $item) : string

Supply the content for a custom column

Parameters

$item

Returns

string —

HTML markup to be placed inside the column

pagination()

pagination(  $which) 

Display the pagination, adding view, search and filter arguments

Parameters

$which

get_columns()

get_columns() : array

This method dictates the table's columns and titles

Returns

array —

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

get_hidden_columns()

get_hidden_columns() : array

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

Returns

array —

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

get_sortable_columns()

get_sortable_columns() : array

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.

Returns

array —

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

print_column_headers()

print_column_headers(boolean  $with_id = true) 

Print column headers, adding view, search and filter arguments

Parameters

boolean $with_id

Whether to set the id attribute or not

mla_get_view()

mla_get_view(  $view_slug,   $current_view) : string

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

Parameters

$view_slug
$current_view

Returns

string —

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

get_views()

get_views() : array

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

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

Returns

array —

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

get_bulk_actions()

get_bulk_actions() : array

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

Returns

array —

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

display_tablenav()

display_tablenav(  $which) 

Generate the table navigation above or below the table

Adds the list/grid switcher in WP 4.0+

Parameters

$which

extra_tablenav()

extra_tablenav(  $which) : void

Extra controls to be displayed between bulk actions and pagination

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

Parameters

$which

prepare_items()

prepare_items() 

Prepares the list of items for displaying

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().

single_row()

single_row(  $item) : void

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

Parameters

$item

_avail_mime_types()

_avail_mime_types(  $num_posts) : array

Get MIME types with one or more attachments for view preparation

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

Parameters

$num_posts

Returns

array —

Mime type names

_format_post_status()

_format_post_status(  $post_status) : string

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

Parameters

$post_status

Returns

string —

Status label or empty string

get_default_primary_column_name()

get_default_primary_column_name() : string

Get the name of the default primary column.

Returns

string —

Name of the default primary column

handle_row_actions()

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

Generate and display row actions links.

Parameters

object $item

Attachment being acted upon.

string $column_name

Current column name.

string $primary

Primary column name.

Returns

string —

Row actions output for media attachments.

_build_rollover_actions()

_build_rollover_actions(  $item,   $column) : array

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

Parameters

$item
$column

Returns

array —

Names and URLs of row-level actions

_build_item_thumbnail()

_build_item_thumbnail(  $item) : string

Generate item thumbnail image tag

Parameters

$item

Returns

string —

HTML for thumbnail

_build_inline_data()

_build_inline_data(  $item) : string

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

Parameters

$item

Returns

string —

HTML

with row data

_handle_primary_column()

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

Format primary column before/after Wordpress v4.3

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.

Parameters

$item
$column_name
$column_content

Returns

string —

Complete column content

_get_view()

_get_view(  $view_slug,   $current_view) : string

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

Parameters

$view_slug
$current_view

Returns

string —

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