WC_Product_Table_Args
extends Table_Args
in package
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 : array<string|int, 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 : 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>
- $args : array<string|int, mixed>
- $column_replacements : array<string|int, mixed>
- $standard_columns : array<string|int, mixed>
- __construct() : mixed
- __get() : mixed
- back_compat_args() : array<string|int, mixed>
- Maintain support for old args names.
- get_args() : mixed
- get_defaults() : mixed
- get_user_defaults() : mixed
- is_multi_add_to_cart() : mixed
- parse_columns_arg() : mixed
- parse_filters_arg() : mixed
- set_args() : mixed
- 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 array<string|int, mixed>
$default_args
= [
'columns' => 'image,name,short-description,price,buy',
// any from $standard_columns, any attribute (att:pa_colour), taxonomy (tax:product_vendor) or custom field (cf:my_field)
'widths' => '',
'auto_width' => true,
'priorities' => '',
'column_breakpoints' => '',
'responsive_control' => 'inline',
// inline or column
'responsive_display' => 'child_row',
// child_row, child_row_visible, or modal
'wrap' => true,
'show_footer' => false,
'search_on_click' => true,
'filters' => false,
'quantities' => false,
'variations' => false,
'cart_button' => 'button',
// button, button_checkbox, checkbox
'ajax_cart' => true,
'scroll_offset' => 15,
'description_length' => 15,
// number of words
'links' => 'all',
// allowed: all, none, or any combination of id, sku, name, image, tags, categories, terms, attributes
'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' => '',
// no default set - @see parse_args
'status' => 'publish',
'category' => '',
// list of slugs or IDs
'exclude_category' => '',
// list of slugs or IDs
'tag' => '',
// list of slugs or IDs
'term' => '',
// list of terms of the form <taxonomy>:<term>
'numeric_terms' => false,
// set to true if using categories, tags or terms with numeric slugs
'cf' => '',
// list of custom fields of the form <field_key>:<field_value>
'year' => '',
// four digit year, e.g. 2011
'month' => '',
// two digit month, e.g. 12
'day' => '',
// two digit day, e.g. 03
'exclude' => '',
// list of post IDs
'include' => '',
// list of post IDs
'search_term' => '',
'show_hidden' => false,
]
The default table args.
$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
public
mixed
$show_hidden
$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
private
static array<string|int, mixed>
$_user_defaults
= null
The default table args after merging with the saved settings.
$args
private
array<string|int, mixed>
$args
= []
The original args array.
$column_replacements
private
static array<string|int, mixed>
$column_replacements
= ['ID' => 'id', 'SKU' => 'sku', 'title' => 'name', 'content' => 'description', 'excerpt' => 'short-description', 'category' => 'categories', 'rating' => 'reviews', 'add-to-cart' => 'buy']
Some column replacements used for correcting misspelled columns.
$standard_columns
private
static array<string|int, mixed>
$standard_columns
= ['id', 'sku', 'name', 'description', 'short-description', 'date', 'categories', 'tags', 'image', 'reviews', 'stock', 'weight', 'dimensions', 'price', 'buy', 'button']
The full list of standard columns (excludes prefixed columns such as custom fields, taxonomies, and attributes).
Methods
__construct()
public
__construct([array<string|int, mixed> $args = [] ]) : mixed
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()
public
get_args() : mixed
Return values
mixed —get_defaults()
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()
public
set_args(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
Return values
mixed —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