Posts_Table extends Abstract_View Uses Resolves_Data_Source

Represents a data table of WP_Post objects.

This class is responsible for creating the table from the supplied args and returning it as a Html_Data_Table object.

Tags
author

Barn2 Plugins [email protected]

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

__construct()  : mixed
Constructor.
get_table()  : mixed
Returns the table view (object, html, or json).
create_columns()  : Table_Columns
Create columns using PTP's Table_Columns.
create_config_builder()  : Abstract_Config_Builder
Create config builder.
create_hooks()  : Abstract_Hook_Manager
Create the hook manager.
create_view_args()  : Table_Args
Create view args using PTP's Table_Args.
enqueue_view_scripts()  : void
Enqueues the view scripts.
get_view_id_prefix()  : string
Returns the view ID prefix for this plugin.

Methods

__construct()

Constructor.

public __construct(string $id[, array<string|int, mixed> $args = [] ][, Data_Source_Interface|null|mixed $data_source = null ]) : mixed

Maintains the legacy constructor signature while supporting the DVE data source dependency.

Parameters
$id : string

The table ID.

$args : array<string|int, mixed> = []

Table arguments.

$data_source : Data_Source_Interface|null|mixed = null

Optional data source.

Tags
Return values
mixed

get_table()

Returns the table view (object, html, or json).

public get_table([string $output = 'object' ]) : mixed
Parameters
$output : string = 'object'

The output type. Defaults to 'object'

Tags
deprecated

Use get_view() instead.

Return values
mixed

The table view data

create_config_builder()

Create config builder.

protected create_config_builder() : Abstract_Config_Builder

Uses PTP's Config_Builder for legacy DataTables mode, or the DVE Dataviews_Config_Builder for new DataViews mode.

Tags
Return values
Abstract_Config_Builder

The config builder.

create_hooks()

Create the hook manager.

protected create_hooks() : Abstract_Hook_Manager
Tags
Return values
Abstract_Hook_Manager

create_view_args()

Create view args using PTP's Table_Args.

protected create_view_args(array<string|int, mixed> $args) : Table_Args

Overrides the parent to use PTP-specific argument validation including filter and column validation for the post type.

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

The raw arguments.

Tags
Return values
Table_Args

The table args object.

enqueue_view_scripts()

Enqueues the view scripts.

protected enqueue_view_scripts() : void
Tags
Return values
void

get_view_id_prefix()

Returns the view ID prefix for this plugin.

protected get_view_id_prefix() : string
Tags
Return values
string

Search results