Table_Args extends View_Args
Responsible for storing and validating the posts table arguments.
Extends View_Args to add PTP-specific validation logic.
Tags
Table of Contents
- __construct() : mixed
- Constructor.
- get_defaults() : mixed
- get_site_defaults() : array<string|int, mixed>
- Get the default table args, including plugin settings.
- get_table_defaults() : array<string|int, mixed>
- Get the initial default table args, not including plugin settings.
- get_user_defaults() : mixed
- parse_args() : mixed
- Parse and validate the arguments.
- apply_existing_headings() : array<string|int, mixed>
- Preserve previously parsed heading values for parsed list keys.
- validate_columns_for_post_type() : mixed
- Validate columns and remove non-applicable ones for post type.
- validate_filters_for_post_type() : mixed
- Validate filters and remove non-applicable ones for post type.
- validate_post_type() : mixed
- Validate post type and handle attachment special case.
- validate_private_status() : mixed
- Ensure private posts are hidden if user lacks capability.
- validate_search_terms() : mixed
- Validate search terms.
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $args = [] ][, Data_Source_Interface|null $data_source = null ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
-
The table arguments.
- $data_source : Data_Source_Interface|null = null
-
The data source.
Tags
Return values
mixed —get_defaults()
public
static get_defaults() : mixed
Tags
Return values
mixed —get_site_defaults()
Get the default table args, including plugin settings.
public
static get_site_defaults([array<string|int, mixed> $overrides = [] ]) : array<string|int, mixed>
Parameters
- $overrides : array<string|int, mixed> = []
-
Optional overrides.
Tags
Return values
array<string|int, mixed> —The site defaults.
get_table_defaults()
Get the initial default table args, not including plugin settings.
public
static get_table_defaults() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The table defaults.
get_user_defaults()
public
static get_user_defaults() : mixed
Tags
Return values
mixed —parse_args()
Parse and validate the arguments.
protected
parse_args(array<string|int, mixed> $args) : mixed
Overrides parent to add PTP-specific validation.
Parameters
- $args : array<string|int, mixed>
-
The arguments to parse.
Tags
Return values
mixed —apply_existing_headings()
Preserve previously parsed heading values for parsed list keys.
private
apply_existing_headings(array<string|int, mixed> $parsed, mixed $headings) : array<string|int, mixed>
Parameters
- $parsed : array<string|int, mixed>
-
Parsed [ key => heading ] map.
- $headings : mixed
-
Heading values aligned by index.
Tags
Return values
array<string|int, mixed> —validate_columns_for_post_type()
Validate columns and remove non-applicable ones for post type.
private
validate_columns_for_post_type() : mixed
Tags
Return values
mixed —validate_filters_for_post_type()
Validate filters and remove non-applicable ones for post type.
private
validate_filters_for_post_type() : mixed
Tags
Return values
mixed —validate_post_type()
Validate post type and handle attachment special case.
private
validate_post_type() : mixed
Tags
Return values
mixed —validate_private_status()
Ensure private posts are hidden if user lacks capability.
private
validate_private_status() : mixed
Tags
Return values
mixed —validate_search_terms()
Validate search terms.
private
validate_search_terms() : mixed