Columns_Util
Column utility functions.
Tags
Table of Contents
- $column_defaults : array<string|int, mixed>
- Column default headings and priorities.
- check_blank_heading() : mixed
- column_defaults() : mixed
- columns_array_to_string() : mixed
- get_column_class() : mixed
- get_column_data_source() : mixed
- get_column_name() : mixed
- get_column_taxonomy() : string|false
- Get the taxonomy slug for a column name.
- get_custom_field() : mixed
- get_custom_taxonomy() : mixed
- get_filter_column() : mixed
- get_hidden_filter() : mixed
- is_custom_field() : mixed
- is_custom_taxonomy() : mixed
- is_filter_column() : mixed
- is_hidden_filter() : mixed
- parse_columns() : array<string|int, mixed>
- Parse the supplied columns into an array, whose keys are the column names, and values are the column headings (if specified).
- parse_filters() : array<string|int, mixed>
- Parse the supplied filters into an array, whose keys are the filter names, and values are the filter headings (if specified).
- remove_non_applicable_columns() : mixed
- sanitize_heading() : mixed
- unprefix_column() : mixed
Properties
$column_defaults
Column default headings and priorities.
private
static array<string|int, mixed>
$column_defaults
= null
Tags
Methods
check_blank_heading()
public
static check_blank_heading(mixed $heading) : mixed
Parameters
- $heading : mixed
Tags
Return values
mixed —column_defaults()
public
static column_defaults() : mixed
Return values
mixed —columns_array_to_string()
public
static columns_array_to_string(array<string|int, mixed> $columns) : mixed
Parameters
- $columns : array<string|int, mixed>
Tags
Return values
mixed —get_column_class()
public
static get_column_class(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —get_column_data_source()
public
static get_column_data_source(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —get_column_name()
public
static get_column_name(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —get_column_taxonomy()
Get the taxonomy slug for a column name.
public
static get_column_taxonomy(string $column) : string|false
Parameters
- $column : string
-
The name of the column.
Tags
Return values
string|false —The taxonomy slug, or false if the column is not a taxonomy column.
get_custom_field()
public
static get_custom_field(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —get_custom_taxonomy()
public
static get_custom_taxonomy(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —get_filter_column()
public
static get_filter_column(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —get_hidden_filter()
public
static get_hidden_filter(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —is_custom_field()
public
static is_custom_field(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —is_custom_taxonomy()
public
static is_custom_taxonomy(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —is_filter_column()
public
static is_filter_column(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —is_hidden_filter()
public
static is_hidden_filter(mixed $column) : mixed
Parameters
- $column : mixed
Tags
Return values
mixed —parse_columns()
Parse the supplied columns into an array, whose keys are the column names, and values are the column headings (if specified).
public
static parse_columns(string|array<string|int, string> $columns) : array<string|int, mixed>
Invalid taxonomies are removed, but non-standard columns are kept as they could be custom columns. Custom field keys are not validated.
E.g. parse_columns( 'title,author:User,content,tax:region:Area,cf:my_field' );
Returns:
[ 'title' => '', 'author' => 'User', 'content' => '', 'tax:region' => 'Area', 'cf:my_field' => '' ];
Parameters
- $columns : string|array<string|int, string>
-
The columns to parse as a string or array of strings.
Tags
Return values
array<string|int, mixed> —The parsed columns.
parse_filters()
Parse the supplied filters into an array, whose keys are the filter names, and values are the filter headings (if specified).
public
static parse_filters(bool|string|array<string|int, string> $filters[, array<string|int, string> $table_columns = [] ]) : array<string|int, mixed>
Invalid filter columns and taxonomies are removed. When $filters = true, the filters are based on the table contents and this is specified by passing the columns in the $table_columns arg.
E.g. parse_filters( 'categories:Category,invalid,tags,tax:region:Area' );
Returns:
[ 'categories' => 'Category', 'tags' => '', 'tax:region' => 'Area' ];
Parameters
- $filters : bool|string|array<string|int, string>
-
The filters to parse as a string or array of strings.
- $table_columns : array<string|int, string> = []
-
The columns to base the filters on when $filters = true.
Tags
Return values
array<string|int, mixed> —The parsed filters, or an empty array if the filters are invalid.
remove_non_applicable_columns()
public
static remove_non_applicable_columns(mixed $columns, mixed $post_type) : mixed
Parameters
- $columns : mixed
- $post_type : mixed
Tags
Return values
mixed —sanitize_heading()
public
static sanitize_heading(mixed $heading) : mixed
Parameters
- $heading : mixed
Tags
Return values
mixed —unprefix_column()
public
static unprefix_column(mixed $column) : mixed
Parameters
- $column : mixed