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>
- $autoload_shortcode : bool
Methods
- __construct() : mixed
- SLP_Base_Object constructor.
- activate() : void
- Activate the shortcode processing.
- clear_ajax_response() : void
- Clear AJAX response.
- get_instance() : SLP_Base_Object
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- initialize() : void
- Do at startup.
- 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() : void
- Set our properties.
- set_ajax_response() : void
- Get location data if it would come back to JS via AJAX handler.
Constants
shortcode
public
mixed
shortcode
= 'slp_option'
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.
$autoload_shortcode
protected
bool
$autoload_shortcode
= \false
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() : void
clear_ajax_response()
Clear AJAX response.
public
final clear_ajax_response() : void
get_instance()
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
public
static get_instance([null|array<string|int, mixed> $options = array() ]) : SLP_Base_Object
Parameters
- $options : null|array<string|int, mixed> = array()
-
object init params
Return values
SLP_Base_Objectinitialize()
Do at startup.
public
final initialize() : void
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>
Tags
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
stringset_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : void
Parameters
- $options : array<string|int, mixed> = array()
set_ajax_response()
Get location data if it would come back to JS via AJAX handler.
protected
final set_ajax_response() : void