Settings
Utility functions for the product table settings.
Tags
Table of Contents
- OPTION_MISC = 'wcpt_misc_settings'
- OPTION_TABLE_DEFAULTS = 'wcpt_shortcode_defaults'
- OPTION_TABLE_STYLING = 'wcpt_table_styling'
- Option names for our plugin settings (i.e. the option keys used in wp_options).
- SECTION_SLUG = 'product-table'
- The section name within the main WooCommerce Settings.
- add_selected_to_cart_default_text() : string
- Get the default 'Add Selected To Cart' text.
- bool_to_yes_no() : string
- Convert boolean values to strings such as "yes" or "no".
- get_setting_misc() : mixed
- get_setting_table_defaults() : mixed
- get_setting_table_styling() : mixed
- get_settings_list() : array<string|int, mixed>
- open_links_in_quick_view_pro() : bool
- Should we open table links with QVP.
- sanitize_option_misc() : mixed
- sanitize_option_table_defaults() : mixed
- sanitize_option_table_styling() : mixed
- sanitize_setting() : mixed
- settings_to_table_defaults() : mixed
- to_woocommerce_settings() : mixed
- update_setting_misc() : mixed
- update_setting_table_defaults() : mixed
- yes_no_to_boolean() : bool|mixed
- get_setting() : mixed
- get_setting_name() : mixed
- maybe_checkbox_setting_to_bool() : mixed|bool
- Maybe convert a 'yes' or 'no' string to a bool.
Constants
OPTION_MISC
public
mixed
OPTION_MISC
= 'wcpt_misc_settings'
OPTION_TABLE_DEFAULTS
public
mixed
OPTION_TABLE_DEFAULTS
= 'wcpt_shortcode_defaults'
OPTION_TABLE_STYLING
Option names for our plugin settings (i.e. the option keys used in wp_options).
public
mixed
OPTION_TABLE_STYLING
= 'wcpt_table_styling'
SECTION_SLUG
The section name within the main WooCommerce Settings.
public
mixed
SECTION_SLUG
= 'product-table'
Methods
add_selected_to_cart_default_text()
Get the default 'Add Selected To Cart' text.
public
static add_selected_to_cart_default_text() : string
Tags
Return values
string —bool_to_yes_no()
Convert boolean values to strings such as "yes" or "no".
public
static bool_to_yes_no(mixed $val) : string
Parameters
- $val : mixed
Tags
Return values
string —'yes' if true, 'no' otherwise
get_setting_misc()
public
static get_setting_misc() : mixed
Return values
mixed —get_setting_table_defaults()
public
static get_setting_table_defaults() : mixed
Return values
mixed —get_setting_table_styling()
public
static get_setting_table_styling() : mixed
Return values
mixed —get_settings_list()
public
static get_settings_list(Licensed_Plugin $plugin) : array<string|int, mixed>
Parameters
- $plugin : Licensed_Plugin
Tags
Return values
array<string|int, mixed> —open_links_in_quick_view_pro()
Should we open table links with QVP.
public
static open_links_in_quick_view_pro() : bool
Tags
Return values
bool —sanitize_option_misc()
public
static sanitize_option_misc(mixed $value, mixed $option, mixed $raw_value) : mixed
Parameters
- $value : mixed
- $option : mixed
- $raw_value : mixed
Return values
mixed —sanitize_option_table_defaults()
public
static sanitize_option_table_defaults(mixed $value, mixed $option, mixed $raw_value) : mixed
Parameters
- $value : mixed
- $option : mixed
- $raw_value : mixed
Return values
mixed —sanitize_option_table_styling()
public
static sanitize_option_table_styling(mixed $value, mixed $option, mixed $raw_value) : mixed
Parameters
- $value : mixed
- $option : mixed
- $raw_value : mixed
Return values
mixed —sanitize_setting()
public
static sanitize_setting(mixed $value, mixed $setting) : mixed
Parameters
- $value : mixed
- $setting : mixed
Return values
mixed —settings_to_table_defaults()
public
static settings_to_table_defaults(mixed $settings) : mixed
Parameters
- $settings : mixed
Return values
mixed —to_woocommerce_settings()
public
static to_woocommerce_settings(mixed $args) : mixed
Parameters
- $args : mixed
Return values
mixed —update_setting_misc()
public
static update_setting_misc(array<string|int, mixed> $settings) : mixed
Parameters
- $settings : array<string|int, mixed>
Return values
mixed —update_setting_table_defaults()
public
static update_setting_table_defaults(array<string|int, mixed> $settings) : mixed
Parameters
- $settings : array<string|int, mixed>
Return values
mixed —yes_no_to_boolean()
public
static yes_no_to_boolean( $val) : bool|mixed
Parameters
Tags
Return values
bool|mixed —get_setting()
private
static get_setting(mixed $option_name[, mixed $default = [] ]) : mixed
Parameters
- $option_name : mixed
- $default : mixed = []
Return values
mixed —get_setting_name()
private
static get_setting_name(mixed $option, mixed $option_name) : mixed
Parameters
- $option : mixed
- $option_name : mixed
Return values
mixed —maybe_checkbox_setting_to_bool()
Maybe convert a 'yes' or 'no' string to a bool.
private
static maybe_checkbox_setting_to_bool(mixed $val) : mixed|bool
Parameters
- $val : mixed
-
The option value.
Return values
mixed|bool —bool if 'yes' or 'no', otherwise the original value.