Settings
Handles the plugin settings saved in WooCommerce.
Tags
Table of Contents
- NUMERIC_SETTINGS = ['menu_page', 'categories', 'columns', 'image_size']
- The list of settings that are numeric. These can be single numbers or an array of numbers.
- add_shortcode_to_page() : void
- Add the plugin's shortcode to a page given a page id.
- get_availability_settings() : array<string|int, mixed>
- Get the availability settings for the settings page.
- get_general_settings() : array<string|int, mixed>
- Get the general settings for the settings page.
- get_id() : mixed
- get_order_form_settings() : array<string|int, mixed>
- Get the order form settings for the settings page.
- get_product_categories_list() : array<string|int, mixed>
- Get the list of categories for the order form category setting.
- get_restaurant_info_max_length() : mixed
- get_restaurant_info_settings() : array<string|int, mixed>
- Get the restaurant info for the settings page.
- get_section_header_description() : string
- Get the main section description, including our support links.
- get_setting() : mixed
- get_settings() : mixed
- get_setting_value() : mixed
- get_settings_map() : array<string|int, mixed>
- Returns a map of settings to their corresponding database keys (e.g. for get_option).
Constants
NUMERIC_SETTINGS
The list of settings that are numeric. These can be single numbers or an array of numbers.
private
array<string|int, string>
NUMERIC_SETTINGS
= ['menu_page', 'categories', 'columns', 'image_size']
The list of numeric settings.
Methods
add_shortcode_to_page()
Add the plugin's shortcode to a page given a page id.
public
static add_shortcode_to_page(string|int $order_page) : void
Parameters
- $order_page : string|int
Return values
void —get_availability_settings()
Get the availability settings for the settings page.
public
static get_availability_settings() : array<string|int, mixed>
Return values
array<string|int, mixed> —The array of settings.
get_general_settings()
Get the general settings for the settings page.
public
static get_general_settings(Licensed_Plugin $plugin) : array<string|int, mixed>
Parameters
- $plugin : Licensed_Plugin
-
The plugin object.
Return values
array<string|int, mixed> —The array of settings.
get_id()
public
static get_id(mixed $setting) : mixed
Parameters
- $setting : mixed
Return values
mixed —get_order_form_settings()
Get the order form settings for the settings page.
public
static get_order_form_settings() : array<string|int, mixed>
Return values
array<string|int, mixed> —The array of settings.
get_product_categories_list()
Get the list of categories for the order form category setting.
public
static get_product_categories_list() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of product categories (id => name).
get_restaurant_info_max_length()
public
static get_restaurant_info_max_length() : mixed
Return values
mixed —get_restaurant_info_settings()
Get the restaurant info for the settings page.
public
static get_restaurant_info_settings() : array<string|int, mixed>
Return values
array<string|int, mixed> —The array of settings.
get_section_header_description()
Get the main section description, including our support links.
public
static get_section_header_description(mixed $plugin) : string
Parameters
- $plugin : mixed
Return values
string —The description
get_setting()
public
static get_setting(mixed $setting[, mixed $default = false ]) : mixed
Parameters
- $setting : mixed
- $default : mixed = false
Return values
mixed —get_settings()
public
static get_settings(mixed $settings[, array<string|int, mixed> $defaults = [] ]) : mixed
Parameters
- $settings : mixed
- $defaults : array<string|int, mixed> = []
Return values
mixed —get_setting_value()
private
static get_setting_value(mixed $setting, mixed $default) : mixed
Parameters
- $setting : mixed
- $default : mixed
Return values
mixed —get_settings_map()
Returns a map of settings to their corresponding database keys (e.g. for get_option).
private
static get_settings_map() : array<string|int, mixed>
Return values
array<string|int, mixed> —The settings map