WC_Product_Table_Args extends Table_Args
The Table_Args class is responsible for storing and validating the product table arguments.
Tags
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
$ajax_cart
public
mixed
$ajax_cart
$auto_width
public
mixed
$auto_width
$button_text
public
mixed
$button_text
$cache
public
mixed
$cache
$cart_button
public
mixed
$cart_button
$category
public
mixed
$category
$cf
public
mixed
$cf
$column_breakpoints
public
mixed
$column_breakpoints
$columns
public
mixed
$columns
$date_columns
public
mixed
$date_columns
$date_format
public
mixed
$date_format
$day
public
mixed
$day
$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
public
mixed
$exclude
$exclude_category
public
mixed
$exclude_category
$filter_headings
public
mixed
$filter_headings
$filters
public
mixed
$filters
$headings
public
mixed
$headings
$image_size
public
mixed
$image_size
$include
public
mixed
$include
$lazy_load
public
mixed
$lazy_load
$lightbox
public
mixed
$lightbox
$links
public
mixed
$links
$month
public
mixed
$month
$no_products_filtered_message
public
mixed
$no_products_filtered_message
$no_products_message
public
mixed
$no_products_message
$numeric_terms
public
mixed
$numeric_terms
$offset
public
mixed
$offset
= 0
$page_length
public
mixed
$page_length
$pagination
public
mixed
$pagination
$paging_type
public
mixed
$paging_type
$priorities
public
mixed
$priorities
$product_limit
public
mixed
$product_limit
$quantities
public
mixed
$quantities
$reset_button
public
mixed
$reset_button
$responsive_control
public
mixed
$responsive_control
$responsive_display
public
mixed
$responsive_display
$rows_per_page
public
mixed
$rows_per_page
$scroll_offset
public
mixed
$scroll_offset
$search_box
public
mixed
$search_box
$search_filters
public
mixed
$search_filters
= []
$search_on_click
public
mixed
$search_on_click
$search_term
public
mixed
$search_term
$shortcodes
public
mixed
$shortcodes
$show_footer
public
mixed
$show_footer
$show_hidden_columns
public
mixed
$show_hidden_columns
$sort_by
public
mixed
$sort_by
$sort_order
public
mixed
$sort_order
$status
public
mixed
$status
$tag
public
mixed
$tag
$term
public
mixed
$term
$totals
public
mixed
$totals
$user_products
public
mixed
$user_products
$user_search_term
public
mixed
$user_search_term
$variations
public
mixed
$variations
$widths
public
mixed
$widths
$wrap
public
mixed
$wrap
$year
public
mixed
$year
$_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
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