Table_Args
The Table_Args class is responsible for storing and validating the product table arguments.
It parses an array of args into their corresponding properties.
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>
- The full list of supported table options and their default values.
- $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
- $stock : mixed
- $tag : mixed
- $term : mixed
- $totals : mixed
- $user_products : mixed
- $user_search_term : mixed
- $variation_name_format : mixed
- $variations : mixed
- $widths : mixed
- $wrap : mixed
- $year : mixed
- $args : array<string|int, mixed>
- The args array.
- $site_defaults : array<string|int, mixed>
- The site-wide table options after merging with the plugin settings.
- __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
- Magic __get method.
- back_compat_args() : array<string|int, mixed>
- Maintain support for old arg names.
- get_args() : array<string|int, mixed>
- Get the table args.
- get_defaults() : array<string|int, mixed>
- Get the default table args based on the the options set in the plugin settings.
- get_site_defaults() : mixed
- To work with the table builder.
- get_table_defaults() : mixed
- Deprecated.
- get_user_defaults() : mixed
- Deprecated.
- is_multi_add_to_cart() : bool
- Is this table using the multi add to cart feature?
- parse_columns_arg() : mixed
- Deprecated.
- parse_filters_arg() : mixed
- Deprecated.
- 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_taxonomy_or_attribute() : mixed
- array_filter_validate_boolean() : mixed
- parse_args() : mixed
- set_columns() : mixed
- set_filters() : mixed
- set_image_column_width() : mixed
- set_image_size() : 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
The full list of supported table options and their default values.
public
static array<string|int, 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' => true, 'quantities' => false, 'variations' => false, 'variation_name_format' => 'full', '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' => true, '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' => '', 'stock' => '', 'show_hidden_columns' => false]
The default args.
Tags
$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
$stock
public
mixed
$stock
$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
$variation_name_format
public
mixed
$variation_name_format
$variations
public
mixed
$variations
$widths
public
mixed
$widths
$wrap
public
mixed
$wrap
$year
public
mixed
$year
$args
The args array.
private
array<string|int, mixed>
$args
= []
$site_defaults
The site-wide table options after merging with the plugin settings.
private
static array<string|int, mixed>
$site_defaults
= null
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>
-
{
Tags
Return values
mixed —__get()
Magic __get method.
public
__get(string $name) : mixed
Parameters
- $name : string
-
The property to get.
Return values
mixed —back_compat_args()
Maintain support for old arg names.
public
static back_compat_args(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
-
The product table args to check.
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 table args based on the the options set in the plugin settings.
public
static get_defaults() : array<string|int, mixed>
Return values
array<string|int, mixed> —The site defaults.
get_site_defaults()
To work with the table builder.
public
static get_site_defaults() : mixed
Return values
mixed —get_table_defaults()
Deprecated.
public
static get_table_defaults() : mixed
Tags
Return values
mixed —get_user_defaults()
Deprecated.
public
static get_user_defaults() : mixed
Tags
Return values
mixed —is_multi_add_to_cart()
Is this table using the multi add to cart feature?
public
is_multi_add_to_cart() : bool
Return values
bool —true if multi-cart is enabled.
parse_columns_arg()
Deprecated.
public
static parse_columns_arg(mixed $columns) : mixed
Parameters
- $columns : mixed
Tags
Return values
mixed —parse_filters_arg()
Deprecated.
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
Tags
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
array_filter_custom_field_or_taxonomy(mixed $column) : mixed
Parameters
- $column : mixed
Return values
mixed —array_filter_taxonomy_or_attribute()
private
array_filter_taxonomy_or_attribute(mixed $column) : mixed
Parameters
- $column : mixed
Return values
mixed —array_filter_validate_boolean()
private
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 —set_columns()
private
set_columns() : mixed
Return values
mixed —set_filters()
private
set_filters() : mixed
Return values
mixed —set_image_column_width()
private
set_image_column_width() : mixed
Return values
mixed —set_image_size()
private
set_image_size() : mixed