SLP_Power_Category_Selector_Manager
extends SLPlus_BaseClass_Object
in package
Manage the category selectors.
Table of Contents
Properties
- $addon : mixed
- $myslp : MySLP
- $selectors : mixed
- $slplus : SLPlus
- $uses_myslp : bool
- $uses_slplus : bool
- $slug : 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() : static
- 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
mixed
$addon
$myslp
public
MySLP
$myslp
$selectors
public
mixed
$selectors
$slplus
public
SLPlus
$slplus
$uses_myslp
public
bool
$uses_myslp
Set to true to add a $myslp property pointing to global $myslp
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$slug
protected
mixed
$slug
$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() ]) : static
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
staticget_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)