WC_Product_Table_Args extends Table_Args

The Table_Args class is responsible for storing and validating the product table arguments.

Tags
deprecated
2.7

Replaced by Barn2\Plugin\WC_Product_Table\Table_Args.

Table of Contents

$add_selected_button  : mixed
$ajax_cart  : mixed
$auto_width  : mixed
$button_text  : mixed
$cache  : mixed
$cart_button  : mixed
$category  : mixed
$cf  : mixed
$column_breakpoints  : mixed
$columns  : mixed
$date_columns  : mixed
$date_format  : mixed
$day  : mixed
$default_args  : mixed
$description_length  : mixed
$exclude  : mixed
$exclude_category  : mixed
$filter_headings  : mixed
$filters  : mixed
$headings  : mixed
$image_size  : mixed
$include  : mixed
$lazy_load  : mixed
$lightbox  : mixed
$links  : mixed
$month  : mixed
$no_products_filtered_message  : mixed
$no_products_message  : mixed
$numeric_terms  : mixed
$offset  : mixed
$page_length  : mixed
$pagination  : mixed
$paging_type  : mixed
$priorities  : mixed
$product_limit  : mixed
$quantities  : mixed
$reset_button  : mixed
$responsive_control  : mixed
$responsive_display  : mixed
$rows_per_page  : mixed
$scroll_offset  : mixed
$search_box  : mixed
$search_filters  : mixed
$search_on_click  : mixed
$search_term  : mixed
$shortcodes  : mixed
$show_footer  : mixed
$show_hidden_columns  : mixed
$sort_by  : mixed
$sort_order  : mixed
$status  : mixed
$tag  : mixed
$term  : mixed
$totals  : mixed
$user_products  : mixed
$user_search_term  : mixed
$variations  : mixed
$widths  : mixed
$wrap  : mixed
$year  : mixed
$_user_defaults  : array<string|int, mixed>
The default table args after merging with the saved settings.
$args  : array<string|int, mixed>
The args array.
$column_replacements  : array<string|int, mixed>
Some column replacements used for correcting misspelled columns.
$standard_columns  : array<string|int, mixed>
The list of standard column name (excludes prefixed columns such as custom fields, taxonomies, and attributes).
__construct()  : mixed
Constructs a new table args object based on the supplied args. Args are validated and any missing args are merged in, and stored in the $args property.
__get()  : mixed
back_compat_args()  : array<string|int, mixed>
Maintain support for old args names.
get_args()  : array<string|int, mixed>
Get the table args.
get_defaults()  : mixed
Get the default args.
get_user_defaults()  : mixed
is_multi_add_to_cart()  : mixed
parse_columns_arg()  : mixed
parse_filters_arg()  : mixed
set_args()  : void
Set the table args. Not all args need to be supplied - new args will be merged in to the existing, and only those specified in the new args will be overwritten.
array_filter_custom_field_or_taxonomy()  : mixed
array_filter_validate_boolean()  : mixed
parse_args()  : mixed
parse_columns()  : mixed
parse_filters()  : mixed
set_image_column_width()  : mixed
settings_to_args()  : mixed

Properties

$add_selected_button

public mixed $add_selected_button

$column_breakpoints

public mixed $column_breakpoints

$default_args

public static mixed $default_args = ['columns' => 'image,name,summary,price,buy', 'widths' => '', 'auto_width' => true, 'priorities' => '', 'column_breakpoints' => '', 'responsive_control' => 'inline', 'responsive_display' => 'child_row', 'wrap' => true, 'show_footer' => false, 'search_on_click' => true, 'filters' => false, 'quantities' => false, 'variations' => false, 'cart_button' => 'button', 'ajax_cart' => true, 'scroll_offset' => 15, 'description_length' => 15, 'links' => 'all', 'lazy_load' => false, 'cache' => false, 'image_size' => '70x70', 'lightbox' => true, 'shortcodes' => false, 'button_text' => '', 'date_format' => '', 'date_columns' => '', 'no_products_message' => '', 'no_products_filtered_message' => '', 'paging_type' => 'numbers', 'page_length' => 'bottom', 'search_box' => 'top', 'totals' => 'bottom', 'pagination' => 'bottom', 'reset_button' => true, 'add_selected_button' => 'top', 'user_products' => false, 'rows_per_page' => 25, 'product_limit' => 500, 'sort_by' => 'menu_order', 'sort_order' => '', 'status' => 'publish', 'category' => '', 'exclude_category' => '', 'tag' => '', 'term' => '', 'numeric_terms' => false, 'cf' => '', 'year' => '', 'month' => '', 'day' => '', 'exclude' => '', 'include' => '', 'search_term' => '', 'show_hidden_columns' => false]

$description_length

public mixed $description_length

$exclude_category

public mixed $exclude_category

$no_products_filtered_message

public mixed $no_products_filtered_message

$no_products_message

public mixed $no_products_message

$responsive_control

public mixed $responsive_control

$responsive_display

public mixed $responsive_display

$search_filters

public mixed $search_filters = []

$show_hidden_columns

public mixed $show_hidden_columns

$user_search_term

public mixed $user_search_term

$_user_defaults

The default table args after merging with the saved settings.

private static array<string|int, mixed> $_user_defaults = null

$args

The args array.

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

$column_replacements

Some column replacements used for correcting misspelled columns.

private static array<string|int, mixed> $column_replacements = [ 'ID' => 'id', 'SKU' => 'sku', 'title' => 'name', 'content' => 'description', 'excerpt' => 'summary', 'short-description' => 'summary', // back compat: old column name 'category' => 'categories', 'rating' => 'reviews', 'add-to-cart' => 'buy', // back compat: old column name 'modified' => 'date_modified', ]

$standard_columns

The list of standard column name (excludes prefixed columns such as custom fields, taxonomies, and attributes).

private static array<string|int, mixed> $standard_columns = ['id', 'sku', 'name', 'description', 'summary', 'date', 'date_modified', 'categories', 'tags', 'image', 'reviews', 'stock', 'weight', 'dimensions', 'price', 'buy', 'button']

Methods

__construct()

Constructs a new table args object based on the supplied args. Args are validated and any missing args are merged in, and stored in the $args property.

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

For any args that can accept a list of items (e.g. $columns, $category, etc) the list should be comma-separated.

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

{

Return values
mixed

__get()

public __get(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

back_compat_args()

Maintain support for old args names.

public static back_compat_args(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

The array of product table attributes

Return values
array<string|int, mixed>

The updated attributes with old ones replaced with their new equivalent

get_args()

Get the table args.

public get_args() : array<string|int, mixed>
Return values
array<string|int, mixed>

The table args.

get_defaults()

Get the default args.

public static get_defaults() : mixed
Tags
deprecated
2.8

Replaced by self::get_user_defaults.

Return values
mixed

get_user_defaults()

public static get_user_defaults() : mixed
Return values
mixed

is_multi_add_to_cart()

public is_multi_add_to_cart() : mixed
Return values
mixed

parse_columns_arg()

public static parse_columns_arg(mixed $columns) : mixed
Parameters
$columns : mixed
Return values
mixed

parse_filters_arg()

public static parse_filters_arg(mixed $filters[, array<string|int, mixed> $columns = [] ][, mixed $variations = false ]) : mixed
Parameters
$filters : mixed
$columns : array<string|int, mixed> = []
$variations : mixed = false
Return values
mixed

set_args()

Set the table args. Not all args need to be supplied - new args will be merged in to the existing, and only those specified in the new args will be overwritten.

public set_args(array<string|int, mixed> $args) : void
Parameters
$args : array<string|int, mixed>

The new table args.

Return values
void

array_filter_custom_field_or_taxonomy()

private static array_filter_custom_field_or_taxonomy(mixed $column) : mixed
Parameters
$column : mixed
Return values
mixed

array_filter_validate_boolean()

private static array_filter_validate_boolean(mixed $var) : mixed
Parameters
$var : mixed
Return values
mixed

parse_args()

private parse_args(array<string|int, mixed> $args) : mixed
Parameters
$args : array<string|int, mixed>
Return values
mixed

parse_columns()

private parse_columns(mixed $columns) : mixed
Parameters
$columns : mixed
Return values
mixed

parse_filters()

private parse_filters(mixed $filters, array<string|int, mixed> $columns, mixed $variations) : mixed
Parameters
$filters : mixed
$columns : array<string|int, mixed>
$variations : mixed
Return values
mixed

set_image_column_width()

private set_image_column_width() : mixed
Return values
mixed

settings_to_args()

private static settings_to_args(mixed $settings) : mixed
Parameters
$settings : mixed
Return values
mixed

Search results