Store Locator Plus®

SLP_Power_UI extends SLP_BaseClass_UI
in package

Interface methods rendering HTML for the public-side front end.

This allows the main plugin to only include this file in the front end via the wp_enqueue_scripts call. Reduces the back-end footprint.

Table of Contents

Properties

$addon  : mixed
$addon  : SLP_BaseClass_Addon
$js_requirements  : array<string|int, string>
$js_settings  : mixed
$js_settings  : array<string|int, string>
$jsHandle  : mixed
$location_property  : mixed
$property_shorthand  : mixed
$slplus  : SLPlus
$slplus  : SLPlus
$uses_slplus  : bool
$js_requirements  : mixed
$slplus  : mixed
$uses_slplus  : mixed
$LegendWalker  : mixed

Methods

__construct()  : mixed
Constructor.
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
add_category_selectors()  : mixed
Add category selector to search layout.
add_discrete_filter_hidden_fields()  : string
Add the discrete filter hidden fields if needed.
add_hooks_and_filters()  : mixed
Add UI specific hooks and filters.
add_tag_selector_to_search_form()  : string
Add tags selector to search layout if it is not already part of the layout.
add_tag_selectors()  : mixed
Add tag selector to search layout.
at_startup()  : mixed
Things we do when starting.
enqueue_ui_css()  : mixed
If the file userinterface.css exists, enqueue it.
enqueue_ui_javascript()  : mixed
Enqueue the userinterface.js scripts (./js/<slug>_userinterface.min.js preferred).
extend_main_shortcode()  : array<string|int, mixed>
Extends the main SLP shortcode approved attributes list, setting defaults.
filter_AddLegend()  : mixed
Add the Tagalong shortcode processing to whatever filter/hook we need it latched on to.
filter_ProcessStorePage()  : array<string|int, mixed>
Perform extra search form element processing.
get_instance()  : SLPlus_BaseClass_Object
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
is_a_valid_directory_redirect()  : bool
Is the current page request a valid directory request?
modify_HTMLPageTitle()  : mixed
Modify the HTML <title> tag page title of the current page.
modify_js_options()  : array<string|int, mixed>
Modify the slplus.options object going into SLP.js
modify_PageTitle()  : mixed
Modify the page title of the current page.
process_slp_search_element_shortcode()  : array<string|int, mixed>
Perform extra search form element processing.
process_tagalong_shortcode()  : mixed
Process the Tagalong shortcode
set_properties()  : mixed
Set our properties.
slp_directory_shortcode()  : mixed
Create the SLPDirectory Shortcode Processor object.
initialize()  : mixed
Do these things when this object is invoked. Override in your class.
add_discrete_filter()  : string
Add the specified discrete field.
create_object_pages()  : mixed
Create and attach the admin processing object.
create_string_category_selector()  : string
Add our custom category selection div to the search form.
create_string_legend_html()  : string
Create the category legend HTML String.
createstring_SearchFormTagDropdown()  : string
Puts the tag list on the search form for users to select tags by drop down.
createstring_SearchFormTagRadioButtons()  : string
Puts the tag list on the search form for users to select tags by radio buttons
createstring_TagDiv()  : string
Create the tag input div wrapper and label.
createstring_TagSelector()  : string
Add our custom tag selection div to the search form.

Properties

$js_requirements

public array<string|int, string> $js_requirements

An array of the JavaScript hooks that are needed by the userinterface.js script. userinterface.js is only loaded if the file exists in the include directory.

$js_settings

public array<string|int, string> $js_settings

JavaScript settings that are to be localized as a _settings JS variable.

$uses_slplus

public bool $uses_slplus

Set to true (default) if the object needs access to the SLPlus plugin object.

Methods

__construct()

Constructor.

public __construct([ $options = array() ]) : mixed
Parameters
$options : = array()

__isset()

public __isset(string $property) : bool
Parameters
$property : string
Return values
bool

add_category_selectors()

Add category selector to search layout.

public add_category_selectors(mixed $layout) : mixed
Parameters
$layout : mixed
Tags
used-by

\SLP_Power_UI::add_hooks_and_filters

add_discrete_filter_hidden_fields()

Add the discrete filter hidden fields if needed.

public add_discrete_filter_hidden_fields(string $layout) : string

Used for directory builder discrete filter by city/state/country on landing page if Experience is not active.

Parameters
$layout : string
Return values
string

add_hooks_and_filters()

Add UI specific hooks and filters.

public add_hooks_and_filters() : mixed

Overrides the base class which is just a stub placeholder.

Tags
uses
SLP_Power_UI::add_category_selectors

fires in \SLP_UI::render_shortcode

add_tag_selector_to_search_form()

Add tags selector to search layout if it is not already part of the layout.

public add_tag_selector_to_search_form( $layout) : string
Parameters
$layout :
Return values
string

add_tag_selectors()

Add tag selector to search layout.

public add_tag_selectors(mixed $layout) : mixed
Parameters
$layout : mixed
Tags
used-by

\SLP_Power_UI::add_hooks_and_filters

at_startup()

Things we do when starting.

public final at_startup() : mixed

enqueue_ui_javascript()

Enqueue the userinterface.js scripts (./js/<slug>_userinterface.min.js preferred).

public enqueue_ui_javascript() : mixed

Minified take precedence.

Called from \MySLP_REST_API::get_options() to send data to front-end/locations.js for embeding maps.

Look first in ./js/_userinterface.js then ./js/userinterface.js then ./include/userinterface.js

extend_main_shortcode()

Extends the main SLP shortcode approved attributes list, setting defaults.

public extend_main_shortcode(array<string|int, mixed> $valid_attributes, array<string|int, mixed> $attributes_in_use, array<string|int, mixed> $content) : array<string|int, mixed>

This will extend the approved shortcode attributes to include the items listed. The array key is the attribute name, the value is the default if the attribute is not set.

Parameters
$valid_attributes : array<string|int, mixed>

current list of approved attributes

$attributes_in_use : array<string|int, mixed>

what the user supplied

$content : array<string|int, mixed>

stuff between the shortcode and end shortcode (nothing)

Tags
usedby

add_hooks_and_filters() via the slp_shortcode_atts filter

Return values
array<string|int, mixed>

filter_AddLegend()

Add the Tagalong shortcode processing to whatever filter/hook we need it latched on to.

public filter_AddLegend(mixed $layoutString) : mixed

The [tagalong] shortcode, used here, is setup in slp_init.

Parameters
$layoutString : mixed
Tags
wp-filter-method

slp_layout

used-by

\SLP_UI::render_shortcode

filter_ProcessStorePage()

Perform extra search form element processing.

public filter_ProcessStorePage(array<string|int, mixed> $attributes) : array<string|int, mixed>
Parameters
$attributes : array<string|int, mixed>
Return values
array<string|int, mixed>

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_Object

is_a_valid_directory_redirect()

Is the current page request a valid directory request?

public is_a_valid_directory_redirect() : bool
Return values
bool

true if the request is a valid directory link.

modify_HTMLPageTitle()

Modify the HTML <title> tag page title of the current page.

public modify_HTMLPageTitle(string $title, string $sep, int $sep_pos) : mixed
Parameters
$title : string
$sep : string
$sep_pos : int

modify_js_options()

Modify the slplus.options object going into SLP.js

public modify_js_options(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>
Tags
used-by

\SLP_UI::localize_script

triggered-by

filter slp_js_options

Return values
array<string|int, mixed>

modify_PageTitle()

Modify the page title of the current page.

public static modify_PageTitle(string $title[, int $id = 0 ]) : mixed
Parameters
$title : string
$id : int = 0

process_slp_search_element_shortcode()

Perform extra search form element processing.

public process_slp_search_element_shortcode(array<string|int, mixed> $attributes) : array<string|int, mixed>
Parameters
$attributes : array<string|int, mixed>
Return values
array<string|int, mixed>

process_tagalong_shortcode()

Process the Tagalong shortcode

public process_tagalong_shortcode(mixed $atts) : mixed
Parameters
$atts : mixed
Tags
wp-filter-method

slp_category

wp-filter-method

slp-tagalong

used-by

\SLP_Power_UI::filter_AddLegend

uses
SLP_Power_UI::create_string_legend_html

set_properties()

Set our properties.

public set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

slp_directory_shortcode()

Create the SLPDirectory Shortcode Processor object.

public slp_directory_shortcode(mixed $attributes, mixed $content, mixed $name) : mixed
Parameters
$attributes : mixed
$content : mixed
$name : mixed

initialize()

Do these things when this object is invoked. Override in your class.

protected initialize() : mixed

add_discrete_filter()

Add the specified discrete field.

private add_discrete_filter(string $property, string $field_name) : string
Parameters
$property : string
$field_name : string
Return values
string

create_object_pages()

Create and attach the admin processing object.

private create_object_pages() : mixed

create_string_category_selector()

Add our custom category selection div to the search form.

private create_string_category_selector(bool $has_label) : string
Parameters
$has_label : bool

Whether or not we should show the label.

Tags
uses
SLP_Power_Category_Selector_Manager::get_html
Return values
string

the HTML for this div appended to the other HTML

create_string_legend_html()

Create the category legend HTML String.

private create_string_legend_html() : string
Tags
wp-filter-method

slp_category

wp-filter-method

slp-tagalong

used-by

\SLP_Power_UI::process_tagalong_shortcode

uses
SLP_Power_UI::create_CategoryWalkerForLegend
Return values
string

createstring_SearchFormTagDropdown()

Puts the tag list on the search form for users to select tags by drop down.

private createstring_SearchFormTagDropdown(array<string|int, string> $tags) : string
Parameters
$tags : array<string|int, string>

tags as an array of strings

Return values
string

createstring_SearchFormTagRadioButtons()

Puts the tag list on the search form for users to select tags by radio buttons

private createstring_SearchFormTagRadioButtons(array<string|int, string> $tags) : string
Parameters
$tags : array<string|int, string>

tags as an array of strings

Return values
string

createstring_TagDiv()

Create the tag input div wrapper and label.

private createstring_TagDiv(string $inner_html) : string
Parameters
$inner_html : string

the input field portion of the div.

Return values
string

the div and label tags added.

createstring_TagSelector()

Add our custom tag selection div to the search form.

private createstring_TagSelector() : string
Return values
string

the HTML for this div appended to the other HTML


        
On this page

Search results