Store Locator Plus®

SLP_UI_Shortcode_slp_option extends SLP_UI_Shortcode
in package

Class SLP_UI_Shortcode_slp_option

Table of Contents

Constants

shortcode  = 'slp_option'

Properties

$ajax_response  : array<string|int, mixed>
$responses  : array<string|int, mixed>
$ajax_response  : mixed
$autoload_shortcode  : mixed
$responses  : mixed

Methods

__construct()  : mixed
SLP_Base_Object constructor.
activate()  : mixed
Activate the shortcode processing.
clear_ajax_response()  : mixed
Clear AJAX response.
get_instance()  : SLPlus_BaseClass_Object
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
modify()  : array<string|int, mixed>
Insert add-on options into the [slp_option <js|nojs|name>="option_value"] shortcode.
process()  : string
Return a plugin option value.
set_properties()  : mixed
Set our properties.
initialize()  : mixed
Do these things when this object is invoked. Override in your class.
set_ajax_response()  : mixed
Get location data is it would come back to JS via AJAX handler.

Constants

Properties

$ajax_response read-only

public array<string|int, mixed> $ajax_response

The current location data being processed as it would come back from an AJAX request

$responses read-only

public array<string|int, mixed> $responses

An array of ajax repsonses with the key = location ID, prevents multiple requests for the same location data. Serves as a memory cache.

Methods

__construct()

SLP_Base_Object constructor.

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

activate()

Activate the shortcode processing.

public final activate() : mixed

clear_ajax_response()

Clear AJAX response.

public final clear_ajax_response() : mixed

modify()

Insert add-on options into the [slp_option <js|nojs|name>="option_value"] shortcode.

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

process()

Return a plugin option value.

public final process(array<string|int, mixed> $attributes, string $content, string $tag) : string

TODO make this mimic the JS output.

[slp_option name="<option_name>"] - render value of option_name setting checking SmartOptions, then nojs, then js options.

[slp_option name="<option_name>" ifset] - only render the span if the option is not empty

[slp_option name="<option_name>" ifset="div"] - only render span if option is not empty and also wrap that span in a div

Parameters
$attributes : array<string|int, mixed>
$content : string
$tag : string
Return values
string

set_properties()

Set our properties.

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

initialize()

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

protected initialize() : mixed

set_ajax_response()

Get location data is it would come back to JS via AJAX handler.

protected final set_ajax_response() : mixed

        
On this page

Search results