Posts_Data_Table extends Posts_Table
Represents a data table of WP_Post objects.
Tags
Table of Contents
- CONTROL_COLUMN_DATA_SOURCE = 'control'
- $args : mixed
- $data_table : mixed
- $hooks : mixed
- $id : mixed
- $query : mixed
- $cache : mixed
- $columns : mixed
- $config_builder : mixed
- $data_added : mixed
- $data_factory : mixed
- $table_initialised : mixed
- __construct() : mixed
- get_data() : object|array<string|int, mixed>|string
- Retrieves the data table containing the list of posts based on the specified arguments.
- get_table() : object|array<string|int, mixed>|string
- Retrieves the data table containing the list of posts based on the arguments supplied on construction.
- update() : mixed
- add_attributes() : mixed
- add_heading() : mixed
- add_headings() : mixed
- add_post_data() : mixed
- add_posts_to_table() : mixed
- array_filter_empty_attribute() : mixed
- can_fetch_data() : mixed
- fetch_data() : mixed
- get_row_attributes() : mixed
- json_encode_config() : mixed
Constants
CONTROL_COLUMN_DATA_SOURCE
public
mixed
CONTROL_COLUMN_DATA_SOURCE
= 'control'
Properties
$args
public
mixed
$args
$data_table
public
mixed
$data_table
$hooks
public
mixed
$hooks
$id
public
mixed
$id
$query
public
mixed
$query
$cache
private
mixed
$cache
$columns
private
mixed
$columns
$config_builder
private
mixed
$config_builder
$data_added
private
mixed
$data_added
= false
$data_factory
private
mixed
$data_factory
$table_initialised
private
mixed
$table_initialised
= false
Methods
__construct()
public
__construct(mixed $id[, mixed $args = [] ]) : mixed
Parameters
- $id : mixed
- $args : mixed = []
Return values
mixed —get_data()
Retrieves the data table containing the list of posts based on the specified arguments.
public
get_data([mixed $output = 'object' ]) : object|array<string|int, mixed>|string
The table returned includes only the table data itself (i.e. the rows), and doesn't include the header, footer, etc.
If the output is 'object' the returned object will be an Html_Data_Table instance. If the output is 'html', the data returned will be a string containing a list of elements, one for each product found. If the output is 'array', the data returned will be an array of rows, one for each product found. if the output is 'json', the data returned will be a JSON-encoded string in the same format as 'array'.
Parameters
- $output : mixed = 'object'
Return values
object|array<string|int, mixed>|string —The posts table data in the requested format.
get_table()
Retrieves the data table containing the list of posts based on the arguments supplied on construction.
public
get_table([string $output = 'object' ]) : object|array<string|int, mixed>|string
The table returned includes the table headings, attributes and data.
If the output is 'object' the returned object is an Html_Data_Table instance. If the output is 'html', the table returned will be a string containing the
element at its root, and include the , and elements. If the output is 'array', the table returned will be an array containing the following keys: 'thead', 'tbody', 'tfoot' and 'attributes'. If the output is 'json', the return value will be a JSON-encoded string in the same format as 'array'.Parameters
- $output : string = 'object'
-
The output format - object, html, array or json. Default 'object'.
Return values
object|array<string|int, mixed>|string —The posts table in the requested format.
update()
public
update(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
Return values
mixed —add_attributes()
private
add_attributes() : mixed
Return values
mixed —add_heading()
private
add_heading(mixed $heading, mixed $attributes, mixed $key) : mixed
Parameters
- $heading : mixed
- $attributes : mixed
- $key : mixed
Return values
mixed —add_headings()
private
add_headings() : mixed
Return values
mixed —add_post_data()
private
add_post_data(mixed $column, mixed $key, mixed $post) : mixed
Parameters
- $column : mixed
- $key : mixed
- $post : mixed
Return values
mixed —add_posts_to_table()
private
add_posts_to_table(mixed $posts) : mixed
Parameters
- $posts : mixed
Return values
mixed —array_filter_empty_attribute()
private
static array_filter_empty_attribute(mixed $value) : mixed
Parameters
- $value : mixed
Return values
mixed —can_fetch_data()
private
can_fetch_data() : mixed
Return values
mixed —fetch_data()
private
fetch_data() : mixed
Return values
mixed —get_row_attributes()
private
get_row_attributes(mixed $post) : mixed
Parameters
- $post : mixed
Return values
mixed —json_encode_config()
private
static json_encode_config(mixed $config) : mixed
Parameters
- $config : mixed