Store Locator Plus®

SLP_UI extends SLPlus_BaseClass_Object
in package

Store Locator Plus basic user interface.

Table of Contents

Properties

$radius_default  : string
$radius_default  : mixed
$radius_selector_radii  : array<string|int, string>
$radius_selector_radii  : mixed
$slplus  : SLPlus
$uses_slplus  : bool
$slplus  : mixed
$uses_slplus  : mixed
$js_attributes  : mixed
$shortcode_map_region  : mixed

Methods

__construct()  : mixed
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
add_to_js_options()  : array<string|int, mixed>
Put map_region from Country_Manager and results_layout from set_ResultsLayout into JavaScript CDATA
create_Map()  : mixed
Create the HTML for the map.
create_MapContent()  : mixed
Replace [slp_mapcontent]
create_MapTagline()  : mixed
Create the map tagline for SLP link
create_Results()  : mixed
Create the HTML for the search results.
create_SearchElement()  : string
Process shortcodes for search form.
create_string_radius_selector()  : string
Build the radius selector string.
create_string_radius_selector_div()  : mixed
Create the default search radius div.
create_string_radius_selector_options()  : string
Create the options HTML for the radius select string.
createstring_DefaultSearchDiv_Address()  : string
Create the default search address div.
createstring_InputDiv()  : string
Create a search form input div.
createstring_SearchForm()  : mixed
Output the search form based on the search results layout.
createstring_TagalongPlaceholder()  : string
Placeholder for the Tagalong legend placement in SLP Layout controls.
filter_SetDefaultMapLayout()  : string
find_default_radius()  : string
Find the default radius in the radii string.
get_instance()  : SLPlus_BaseClass_Object
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
localize_script()  : mixed
Localize the CSL Script
modify_searchlayout()  : string
Modify the search form.
no_texturize_shortcodes()  : array<string|int, mixed>
Do not texturize our shortcodes.
rawDeal()  : string
Strip all \r\n from the template to try to "unbreak" Theme Forest themes.
remove_slp_addon_shortcodes()  : string
Remove the [slp_addon ...] shortcodes from results layout.
render_shortcode()  : string
Process the store locator plus shortcode.
render_slp_block()  : string
Render locations map on front end via Blocks.
set_MapCenter()  : mixed
Set the starting point for the center of the map.
set_properties()  : mixed
Set our properties.
set_ResultsLayout()  : string
Set the results layout string.
setup_stylesheet_for_slplus()  : mixed
Setup the CSS for the product pages.
strip_slashes_from_smart_options()  : mixed
Strip slashes from smart options before putting into JS array.
initialize()  : mixed
Things we do at the start.
assign_user_stylesheet()  : mixed
Assign the plugin specific UI stylesheet.
create_DefaultSearchDiv_Submit()  : mixed
Create the default search submit div.
get_environment()  : array<string|int, mixed>
Get the environment.
get_find_button_text()  : mixed
Retrieve the proper find button default text.
get_messages()  : array<string|int, string>
Set the messages for us in the JS array.
register_locations_map_block_type()  : mixed
Register Locations Map Block Type
set_allowed_attributes()  : array<string|int, mixed>
Set the allowed shortcode attributes.
set_radius_selector_radii()  : mixed
Set the radius_selector_radii array.

Properties

$radius_default

public string $radius_default

Radius Default

$radius_default

public mixed $radius_default

$radius_selector_radii

public array<string|int, string> $radius_selector_radii

A string array of each radius in the slplus->options['radii'] setting.

$radius_selector_radii

public mixed $radius_selector_radii

$uses_slplus

public bool $uses_slplus

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

$js_attributes

private mixed $js_attributes = array()

$shortcode_map_region

private mixed $shortcode_map_region = 'us'

Methods

__construct()

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

__isset()

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

add_to_js_options()

Put map_region from Country_Manager and results_layout from set_ResultsLayout into JavaScript CDATA

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

\SLP_UI::localize_script

uses
SLP_UI::set_ResultsLayout
Return values
array<string|int, mixed>

create_Map()

Create the HTML for the map.

public create_Map() : mixed

create_MapContent()

Replace [slp_mapcontent]

public create_MapContent() : mixed

create_MapTagline()

Create the map tagline for SLP link

public create_MapTagline() : mixed

create_Results()

Create the HTML for the search results.

public create_Results() : mixed

create_SearchElement()

Process shortcodes for search form.

public create_SearchElement(array<string|int, mixed> $attributes[, null|string $content = null ]) : string
Parameters
$attributes : array<string|int, mixed>
$content : null|string = null
Return values
string

create_string_radius_selector()

Build the radius selector string.

public create_string_radius_selector() : string
Return values
string

create_string_radius_selector_div()

Create the default search radius div.

public create_string_radius_selector_div() : mixed

create_string_radius_selector_options()

Create the options HTML for the radius select string.

public create_string_radius_selector_options() : string
Return values
string

createstring_DefaultSearchDiv_Address()

Create the default search address div.

public createstring_DefaultSearchDiv_Address([string $placeholder = '' ]) : string
Parameters
$placeholder : string = ''
Tags
used-by

\SLP_Experience_UI::filter_ProcessSearchElement

used-by

\SLP_UI::create_SearchElement

FILTER: slp_search_default_address

Return values
string

createstring_InputDiv()

Create a search form input div.

public createstring_InputDiv([null|string $fldID = null ][, string $label = '' ][, string $placeholder = '' ][, bool $hidden = false ][, null|string $divID = null ][, string $default = '' ]) : string
Parameters
$fldID : null|string = null
$label : string = ''
$placeholder : string = ''
$hidden : bool = false
$divID : null|string = null
$default : string = ''
Tags
used-by

\SLP_Experience_UI::filter_ProcessSearchElement

used-by

\SLP_UI::createstring_DefaultSearchDiv_Address

Return values
string

createstring_SearchForm()

Output the search form based on the search results layout.

public createstring_SearchForm() : mixed

createstring_TagalongPlaceholder()

Placeholder for the Tagalong legend placement in SLP Layout controls.

public createstring_TagalongPlaceholder(array<string|int, mixed> $attributes[, string $content = '' ]) : string

Does nothing but stop the [tagalong ...] shortcode text from appearing in output when Tagalong is not active.

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

array

$content : string = ''
Return values
string

blank text

filter_SetDefaultMapLayout()

public filter_SetDefaultMapLayout(string $HTML) : string
Parameters
$HTML : string

current map HTML default is blank

Return values
string

modified map HTML

find_default_radius()

Find the default radius in the radii string.

public find_default_radius() : string

It is wrappped with () or the first/only entry in a comma-separated list.

Return values
string

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

localize_script()

Localize the CSL Script

public localize_script() : mixed

All values in the slplus->options array get passed in to JavaScript CDATA as the options property.

Tags
uses
SLP_Experience_UI::modify_js_options

priority 10

uses
SLP_Power_UI::modify_js_options

priority 10

uses
SLP_UI::add_to_js_options

priority 10

triggers

filter slp_js_options

modify_searchlayout()

Modify the search form.

public modify_searchlayout(string $html) : string
Parameters
$html : string
Tags
filters

slp_searchlayout

Return values
string

no_texturize_shortcodes()

Do not texturize our shortcodes.

public static no_texturize_shortcodes(array<string|int, mixed> $shortcodes) : array<string|int, mixed>
Parameters
$shortcodes : array<string|int, mixed>
Return values
array<string|int, mixed>

rawDeal()

Strip all \r\n from the template to try to "unbreak" Theme Forest themes.

public rawDeal(string $inStr) : string

They have a known bug that MANY Theme Forest authors have introduced which will change this:

To this: <table
style="display:none"

Parameters
$inStr : string
Return values
string

remove_slp_addon_shortcodes()

Remove the [slp_addon ...] shortcodes from results layout.

public remove_slp_addon_shortcodes() : string
Return values
string

render_shortcode()

Process the store locator plus shortcode.

public render_shortcode(array<string|int, mixed> $attributes[, array<string|int, mixed> $content = null ]) : string

Variables this function uses and passes to the template we need a better way to pass vars to the template parser so we don't carry around the weight of these global definitions. the other option is to unset($GLOBAL['']) at then end of this function call.

$this->plugin->data to holds attribute data HOWEVER in 4.3+ this is now also stored in slplus->options[] at runtime. EXCEPT for things that are directly updating ->data[...] during slp_shortcode_atts filter or slp_before_render_shortcode action

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

The attributes in use by the shortcode.

$content : array<string|int, mixed> = null
Tags
link

Flowchart for render_shortcode

Return values
string

HTML the shortcode will render

render_slp_block()

Render locations map on front end via Blocks.

public render_slp_block(mixed $attributes) : string
Parameters
$attributes : mixed
Return values
string

set_MapCenter()

Set the starting point for the center of the map.

public set_MapCenter() : mixed

Uses country by default.

set_properties()

Set our properties.

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

set_ResultsLayout()

Set the results layout string.

public set_ResultsLayout([bool $add_shortcode = true ][, bool $raw = false ]) : string
Parameters
$add_shortcode : bool = true

set to false if doing your own slp_location shortcode handling.

$raw : bool = false

set to true to skip the stripslashes and esc_textarea processing.

Return values
string

$html

setup_stylesheet_for_slplus()

Setup the CSS for the product pages.

public setup_stylesheet_for_slplus([string $theme = '' ]) : mixed
Parameters
$theme : string = ''

strip_slashes_from_smart_options()

Strip slashes from smart options before putting into JS array.

public strip_slashes_from_smart_options(mixed $option_array) : mixed
Parameters
$option_array : mixed
Tags
used-by

\SLP_UI::localize_script

initialize()

Things we do at the start.

protected initialize() : mixed

assign_user_stylesheet()

Assign the plugin specific UI stylesheet.

private assign_user_stylesheet(string $themeFile) : mixed

For this to work with shortcode testing you MUST call it via the WordPress wp_footer action hook.

Parameters
$themeFile : string

if set use this theme v. the database setting

create_DefaultSearchDiv_Submit()

Create the default search submit div.

private create_DefaultSearchDiv_Submit() : mixed

If we are not hiding the submit button.

get_environment()

Get the environment.

private get_environment() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_find_button_text()

Retrieve the proper find button default text.

private get_find_button_text() : mixed

get_messages()

Set the messages for us in the JS array.

private get_messages() : array<string|int, string>
Return values
array<string|int, string>

register_locations_map_block_type()

Register Locations Map Block Type

private register_locations_map_block_type() : mixed

set_allowed_attributes()

Set the allowed shortcode attributes.

private set_allowed_attributes(array<string|int, mixed> $attributes) : array<string|int, mixed>

All SmartOptions are allowed. The default value is the current setting value.

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

the attributes in use by the shortcode

Return values
array<string|int, mixed>

the allowed shortcode attributes (key) and their default value (value)

set_radius_selector_radii()

Set the radius_selector_radii array.

private set_radius_selector_radii() : mixed

        
On this page

Search results