Menu_Options
Stores the options for a restaurant order menu.
Tags
Table of Contents
- DD_FULL = 'full'
- DD_LIMITED = 'limited'
- DEFAULTS = ['categories' => 'default', 'order_type' => self::OT_QUICK, 'image_position' => 'left', 'product_image' => true, 'image_size' => 130, 'product_description' => true, 'description_length' => self::DD_LIMITED, 'buy_button' => true, 'category_titles' => true, 'category_descriptions' => true, 'columns' => 2, 'menu_navigation' => true, 'restaurant_info' => true, 'categories_with_hidden_title' => [], 'duplicate_products_in_parent_category' => true, 'delete_data' => 'no']
- OT_CHECK = 'check'
- OT_LIGHTBOX = 'lightbox'
- OT_QUICK = 'quick'
- $args : array<string|int, mixed>
- $product_elements : array<string|int, mixed>
- $category_objects : array<string|int, WP_Term>
- __construct() : mixed
- get_categories() : array<string|int, string>
- Get the list of categories (as category slugs) for this menu.
- get_categories_with_hidden_title() : array<string|int, string>
- Get the list of categories (as category slugs) for which the category title and description are hidden.
- get_category_objects() : array<string|int, WP_Term>
- Get the list of category objects (WP_Term) for this menu.
- get_defaults() : array<string|int, mixed>
- Get the default menu options.
- get_description_length() : string
- Get the menu item description length - DD_LIMITED or DD_FULL.
- get_image_position() : string
- Get the menu item image position - left or right.
- get_image_size() : int
- Get the menu image size in pixels. This will be a single integer value as the image is a square.
- get_num_columns() : int
- Get the number of columns for the menu.
- get_options() : array<string|int, mixed>
- Get the full list of menu options as an array.
- get_order_type() : mixed
- get_product_elements() : mixed
- is_enabled() : mixed
- show_buy_button() : mixed
- show_category_descriptions() : mixed
- show_category_titles() : mixed
- show_duplicate_products_in_parent_category() : mixed
- show_menu_navigation() : mixed
- show_product_description() : mixed
- show_product_image() : mixed
- show_restaurant_info() : mixed
- get_settings() : array<string|int, mixed>
- Get the plugin settings related to the restaurant menu. If no settings are stored, the default value from get_defaults is returned.
- get_terms() : mixed
- parse_args() : mixed
Constants
DD_FULL
public
mixed
DD_FULL
= 'full'
Tags
DD_LIMITED
public
mixed
DD_LIMITED
= 'limited'
Tags
DEFAULTS
public
mixed
DEFAULTS
= ['categories' => 'default', 'order_type' => self::OT_QUICK, 'image_position' => 'left', 'product_image' => true, 'image_size' => 130, 'product_description' => true, 'description_length' => self::DD_LIMITED, 'buy_button' => true, 'category_titles' => true, 'category_descriptions' => true, 'columns' => 2, 'menu_navigation' => true, 'restaurant_info' => true, 'categories_with_hidden_title' => [], 'duplicate_products_in_parent_category' => true, 'delete_data' => 'no']
Tags
OT_CHECK
public
mixed
OT_CHECK
= 'check'
Tags
OT_LIGHTBOX
public
mixed
OT_LIGHTBOX
= 'lightbox'
Tags
OT_QUICK
public
mixed
OT_QUICK
= 'quick'
Tags
Properties
$args
protected
array<string|int, mixed>
$args
The supplied args to create the menu options.
Tags
$product_elements
protected
array<string|int, mixed>
$product_elements
Holds the product elements to display for this menu (image, name, etc)
Tags
$category_objects
private
array<string|int, WP_Term>
$category_objects
Internal list of category objects for this menu.
Tags
Methods
__construct()
public
__construct([array<string|int, mixed> $args = [] ][, bool $load_settings = true ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
- $load_settings : bool = true
Tags
Return values
mixed —get_categories()
Get the list of categories (as category slugs) for this menu.
public
get_categories() : array<string|int, string>
Tags
Return values
array<string|int, string> —get_categories_with_hidden_title()
Get the list of categories (as category slugs) for which the category title and description are hidden.
public
get_categories_with_hidden_title() : array<string|int, string>
Tags
Return values
array<string|int, string> —get_category_objects()
Get the list of category objects (WP_Term) for this menu.
public
get_category_objects() : array<string|int, WP_Term>
Tags
Return values
array<string|int, WP_Term> —get_defaults()
Get the default menu options.
public
static get_defaults() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The defaults
get_description_length()
Get the menu item description length - DD_LIMITED or DD_FULL.
public
get_description_length() : string
Tags
Return values
string —get_image_position()
Get the menu item image position - left or right.
public
get_image_position() : string
Tags
Return values
string —get_image_size()
Get the menu image size in pixels. This will be a single integer value as the image is a square.
public
get_image_size() : int
Tags
Return values
int —The image size in pixels.
get_num_columns()
Get the number of columns for the menu.
public
get_num_columns() : int
Tags
Return values
int —get_options()
Get the full list of menu options as an array.
public
get_options() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The menu options
get_order_type()
public
get_order_type() : mixed
Tags
Return values
mixed —get_product_elements()
public
get_product_elements() : mixed
Tags
Return values
mixed —is_enabled()
public
is_enabled(mixed $data) : mixed
Parameters
- $data : mixed
Tags
Return values
mixed —show_buy_button()
public
show_buy_button() : mixed
Tags
Return values
mixed —show_category_descriptions()
public
show_category_descriptions() : mixed
Tags
Return values
mixed —show_category_titles()
public
show_category_titles() : mixed
Tags
Return values
mixed —show_duplicate_products_in_parent_category()
public
show_duplicate_products_in_parent_category() : mixed
Tags
Return values
mixed —show_menu_navigation()
public
show_menu_navigation() : mixed
Tags
Return values
mixed —show_product_description()
public
show_product_description() : mixed
Tags
Return values
mixed —show_product_image()
public
show_product_image() : mixed
Tags
Return values
mixed —show_restaurant_info()
public
show_restaurant_info() : mixed
Tags
Return values
mixed —get_settings()
Get the plugin settings related to the restaurant menu. If no settings are stored, the default value from get_defaults is returned.
protected
get_settings() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The settings
get_terms()
private
get_terms(array<string|int, mixed> $values) : mixed
Parameters
- $values : array<string|int, mixed>
Tags
Return values
mixed —parse_args()
private
parse_args(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>