MLA_View_List_Table

Extends \WP_List_Table

Class MLA (Media Library Assistant) View List Table implements the "Views" admin settings submenu table

Extends the core WP_List_Table class.

package

Media Library Assistant

since 1.40

Methods

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

__construct() : void
since 1.40

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

_build_inline_data( $item) : string
since 1.40

Arguments

$item

Response

string

HTML

with row data

Add rollover actions to a table column

_build_rollover_actions( $item,  $column) : array
since 1.40

Arguments

$item

$column

Response

array

Names and URLs of row-level actions

Access the default list of hidden columns

_default_hidden_columns() : array
static
since 1.40

Response

array

default list of hidden columns

Checks the current user's permissions

ajax_user_can() : boolean
since 2.14

Response

boolean

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

column_cb( $item) : string
since 1.40

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. All columns should have a specific method, so this function returns a troubleshooting message.

since 1.40

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 1.40

Arguments

$item

Response

string

HTML markup to be placed inside the column

Supply the content for a custom column

column_menu_order( $item) : string
since 1.40

Arguments

$item

Response

string

HTML markup to be placed inside the column

Supply the content for a custom column

column_name( $item) : string
since 1.40

Arguments

$item

Response

string

HTML markup to be placed inside the column

Supply the content for a custom column

column_plural( $item) : string
since 1.40

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 1.40

Arguments

$item

Response

string

HTML markup to be placed inside the column

Supply the content for a custom column

column_singular( $item) : string
since 1.40

Arguments

$item

Response

string

HTML markup to be placed inside the column

Supply the content for a custom column

column_specification( $item) : string
since 1.40

Arguments

$item

Response

string

HTML markup to be placed inside the column

Supply the content for a custom column

column_table_view( $item) : string
since 1.40

Arguments

$item

Response

string

HTML markup to be placed inside the column

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

get_bulk_actions() : array
since 1.40

Response

array

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

This method dictates the table's columns and titles

get_columns() : array
since 1.40

Response

array

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

Get the name of the default primary column.

get_default_primary_column_name() : string
since 2.14
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 1.40

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 to sort by. Also notes the current sort column, if set.

get_sortable_columns() : array
since 1.40

Response

array

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

Generate and display row actions links.

handle_row_actions(object $item, string $column_name, string $primary) : string
since 2.14
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.

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

mla_admin_init() : void
static
since 1.40

Handler for filter 'manage_settings_page_mla-settings-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 1.40

Response

array

list of table columns

Handler for filter 'get_user_option_managesettings_page_mla-settings-menu-viewcolumnshidden'

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 1.40

Arguments

$result

$option

$user_data

Response

array

updated 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 1.40

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

single_row( $item) : void
since 1.40

Arguments

$item

Properties

Default values for hidden columns

default_hidden_columns : array
static

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

since
var

Type(s)

array