SLP_Power_Category_Selector_Manager
extends SLPlus_BaseClass_Object
in package
Manage the category selectors.
Table of Contents
Properties
- $addon : SLPPower
- $addon : mixed
- $categoryDropDowns : array<string|int, mixed>
- $node_level : int
- $selectors : array<string|int, SLP_Power_Category_Selector>
- $selectors : mixed
- $slplus : SLPlus
- $uses_slplus : bool
- $slplus : mixed
- $uses_slplus : mixed
- $categoryDropDowns : mixed
- $node_level : mixed
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- create_string_dropdown_div() : string
- Create the div-wrapped HTML with label for the category selector.
- get_html() : mixed
- Return the UI HTML for the named selector.
- get_instance() : SLPlus_BaseClass_Object
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- get_selectors() : array<string|int, mixed>
- Return the selectors as a named array or object array.
- initialize() : mixed
- Initialize the manager.
- set_properties() : mixed
- Set our properties.
- create_default_selectors() : mixed
- Create the default selectors.
- create_dropdown_for_category() : null
- Create a drop down object for all items with a parent category as specified.
- create_string_cascading_category_dropdown() : mixed
- Create a cascading drop down array for location categories.
- create_string_for_cascade_selector() : string
- Create the HTML output string for the single selector type.
- create_string_for_single_selector() : string
- Create the HTML output string for the single selector type.
- create_string_nested_dropdown_divs() : string
- Create nested divs with the drop down menus within.
Properties
$addon
public
SLPPower
$addon
$addon
public
mixed
$addon
$categoryDropDowns read-only
public
array<string|int, mixed>
$categoryDropDowns
The category drop downs.
$node_level read-only
public
int
$node_level
Which level of the nested drop down tree are we processing?
$selectors
public
array<string|int, SLP_Power_Category_Selector>
$selectors
named array, key = slug, value = selector object
$selectors
public
mixed
$selectors
$slplus
public
SLPlus
$slplus
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$slplus
protected
mixed
$slplus
$uses_slplus
protected
mixed
$uses_slplus
= \true
$categoryDropDowns
private
mixed
$categoryDropDowns
= array()
$node_level
private
mixed
$node_level
= 0
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
public
__get(string $property) : SLPlus_BaseClass_Object
Parameters
- $property : string
Return values
SLPlus_BaseClass_Object__isset()
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
boolcreate_string_dropdown_div()
Create the div-wrapped HTML with label for the category selector.
public
create_string_dropdown_div(string $dropdown_html[, int $term_id = 0 ]) : string
Parameters
- $dropdown_html : string
- $term_id : int = 0
Return values
stringget_html()
Return the UI HTML for the named selector.
public
get_html(string $selector_slug, bool $has_label) : mixed
Parameters
- $selector_slug : string
- $has_label : bool
Tags
get_instance()
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
public
static get_instance([bool $no_global = false ][, mixed $params = array() ]) : SLPlus_BaseClass_Object
TODO: PHP7.4 and PHP8.0 the static instance variable returns an object matching $class TODO: PHP8.1 the static instance continually returns the FIRST object (SLP_Admin_Helper) every time -- it is like PHP8.1 static instance is bound to base_class-object versus the calling class object
Parameters
- $no_global : bool = false
-
set to true to skip assigning object to SLP global as a property.
- $params : mixed = array()
-
object init params
Return values
SLPlus_BaseClass_Objectget_selectors()
Return the selectors as a named array or object array.
public
get_selectors() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>initialize()
Initialize the manager.
public
initialize() : mixed
set_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
create_default_selectors()
Create the default selectors.
private
create_default_selectors() : mixed
Tags
create_dropdown_for_category()
Create a drop down object for all items with a parent category as specified.
private
create_dropdown_for_category(string $parent_cat[, mixed $grandparent_cat = null ]) : null
Recursive, calls the same method for each child.
Parameters
- $parent_cat : string
-
the parent category (int)
- $grandparent_cat : mixed = null
-
the grandparent category (int) or null
Return values
nullcreate_string_cascading_category_dropdown()
Create a cascading drop down array for location categories.
private
create_string_cascading_category_dropdown() : mixed
create_string_for_cascade_selector()
Create the HTML output string for the single selector type.
private
create_string_for_cascade_selector(bool $has_label) : string
Parameters
- $has_label : bool
Tags
Return values
stringcreate_string_for_single_selector()
Create the HTML output string for the single selector type.
private
create_string_for_single_selector(bool $has_label) : string
Called via the call_user_func() in get_html().
Parameters
- $has_label : bool
Tags
Return values
stringcreate_string_nested_dropdown_divs()
Create nested divs with the drop down menus within.
private
create_string_nested_dropdown_divs(string $parent_category_id) : string
Parameters
- $parent_category_id : string
-
(int)