WooCommerce Code Reference

WC_Admin_List_Table
in package

WC_Admin_List_Table Class.

Table of Contents

$list_table_type  : string
Post type.
$object  : object|null
Object being shown on the row.
__construct()  : mixed
Constructor.
default_hidden_columns()  : array<string|int, mixed>
Adjust which columns are displayed by default.
define_bulk_actions()  : array<string|int, mixed>
Define bulk actions.
define_columns()  : array<string|int, mixed>
Define which columns to show on this screen.
define_sortable_columns()  : array<string|int, mixed>
Define which columns are sortable.
disable_view_mode()  : array<string|int, mixed>
Removes this type from list of post types that support "View Mode" switching.
handle_bulk_actions()  : string
Handle bulk actions.
list_table_primary_column()  : string
Set list table primary column.
maybe_render_blank_state()  : mixed
Show blank slate.
render_columns()  : mixed
Render individual columns.
request_query()  : array<string|int, mixed>
Handle any filters.
restrict_manage_posts()  : mixed
See if we should render search filters or not.
row_actions()  : array<string|int, mixed>
Set row actions.
define_hidden_columns()  : array<string|int, mixed>
Define hidden columns.
get_primary_column()  : array<string|int, mixed>
Define primary column.
get_row_actions()  : array<string|int, mixed>
Get row actions to show in the list table.
prepare_row_data()  : mixed
Pre-fetch any data for the row each column has access to it.
query_filters()  : array<string|int, mixed>
Handle any custom filters.
render_blank_state()  : mixed
Render blank state. Extend to add content.
render_filters()  : mixed
Render any custom filters and search inputs for the list table.

Properties

Methods

default_hidden_columns()

Adjust which columns are displayed by default.

public default_hidden_columns(array<string|int, mixed> $hidden, object $screen) : array<string|int, mixed>
Parameters
$hidden : array<string|int, mixed>

Current hidden columns.

$screen : object

Current screen.

Return values
array<string|int, mixed>

define_columns()

Define which columns to show on this screen.

public define_columns(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>

Existing columns.

Return values
array<string|int, mixed>

define_sortable_columns()

Define which columns are sortable.

public define_sortable_columns(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>

Existing columns.

Return values
array<string|int, mixed>

disable_view_mode()

Removes this type from list of post types that support "View Mode" switching.

public disable_view_mode(array<string|int, mixed> $post_types) : array<string|int, mixed>

View mode is seen on posts where you can switch between list or excerpt. Our post types don't support it, so we want to hide the useless UI from the screen options tab.

Parameters
$post_types : array<string|int, mixed>

Array of post types supporting view mode.

Return values
array<string|int, mixed>Array of post types supporting view mode, without this type.

handle_bulk_actions()

Handle bulk actions.

public handle_bulk_actions(string $redirect_to, string $action, array<string|int, mixed> $ids) : string
Parameters
$redirect_to : string

URL to redirect to.

$action : string

Action name.

$ids : array<string|int, mixed>

List of ids.

Return values
string

row_actions()

Set row actions.

public row_actions(array<string|int, mixed> $actions, WP_Post $post) : array<string|int, mixed>
Parameters
$actions : array<string|int, mixed>

Array of actions.

$post : WP_Post

Current post object.

Return values
array<string|int, mixed>

get_row_actions()

Get row actions to show in the list table.

protected get_row_actions(array<string|int, mixed> $actions, WP_Post $post) : array<string|int, mixed>
Parameters
$actions : array<string|int, mixed>

Array of actions.

$post : WP_Post

Current post object.

Return values
array<string|int, mixed>