MySLP_Generate_Embed
extends SLP_Base_ReactObject
in package
React-driven Generate Embed page.
Table of Contents
Constants
- DEFAULT_CONTAINER_ID : mixed = 'MySLP-map-wrap'
- PRESENTATIONS : mixed = array('map', 'directory')
Properties
- $addon : object
- $buildDir : string
- $buildURL : string
- $myslp : MySLP
- $pageName : string
- $scriptAssetFile : string
- $scriptFile : string
- $scriptURL : string
- $slplus : SLPlus
- $pluginDir : mixed
- $pluginURL : mixed
- $scriptFilebase : mixed
- $scriptHandle : mixed
- $slug : mixed
- $uses_myslp : bool
- $uses_slplus : bool
- $wrapper_class : mixed
- $notifications : array<string|int, mixed>
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- extend_react_vars() : array<string|int, mixed>
- Add Generate Embed settings to the shared React bootstrap data.
- get_instance() : static
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- render() : void
- Render admin page - default can be overriden.
- render_page() : void
- Process settings and render the Generate Embed application.
- set_properties() : void
- Set our properties.
- enqueueReact() : void
- Things we normally want to do before each render
- get_vars_for_react() : array<string|int, mixed>
- Pass data from PHP to React JavaScript environment.
- initialize() : void
- Configure the React entry point and its WordPress-to-React data filter.
- add_notification() : void
- Queue a message for the React notification stack.
- get_container_id() : string
- Get the saved deployment container ID with a safe legacy fallback.
- get_presentation() : string
- Get the saved presentation with a safe fallback.
- is_valid_container_id() : bool
- Ensure the value can be used safely as an HTML container ID.
- save_settings() : void
- Persist submitted deployment settings.
Constants
DEFAULT_CONTAINER_ID
private
mixed
DEFAULT_CONTAINER_ID
= 'MySLP-map-wrap'
PRESENTATIONS
private
mixed
PRESENTATIONS
= array('map', 'directory')
Properties
$addon
public
object
$addon
$buildDir read-only
public
string
$buildDir
The build directory where the React script lives.
$buildURL read-only
public
string
$buildURL
The build URL where the React script lives.
$myslp
public
MySLP
$myslp
$pageName
public
string
$pageName
The page name for React, update with initialize() override.
$scriptAssetFile read-only
public
string
$scriptAssetFile
The fully qualified file name for the React script supporting an asset PHP file.
$scriptFile read-only
public
string
$scriptFile
The fully qualified file name for the React script.
$scriptURL read-only
public
string
$scriptURL
The URL for the React script.
$slplus
public
SLPlus
$slplus
$pluginDir
protected
mixed
$pluginDir
= \MYSLP_PLUGIN_DIR
$pluginURL
protected
mixed
$pluginURL
= \MYSLP_URL
$scriptFilebase
protected
mixed
$scriptFilebase
= 'generate_embed'
$scriptHandle
protected
mixed
$scriptHandle
= 'generate_embed'
$slug
protected
mixed
$slug
$uses_myslp
protected
bool
$uses_myslp
= \true
$uses_slplus
protected
bool
$uses_slplus
= \true
$wrapper_class
protected
mixed
$wrapper_class
= 'react-wrapper generate-embed-component'
$notifications
private
array<string|int, mixed>
$notifications
= array()
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
boolextend_react_vars()
Add Generate Embed settings to the shared React bootstrap data.
public
extend_react_vars(array<string|int, mixed> $vars) : array<string|int, mixed>
Parameters
- $vars : array<string|int, mixed>
-
Shared React bootstrap data.
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() ]) : 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
staticrender()
Render admin page - default can be overriden.
public
render() : void
Provide the DOM element where the React app will render: slp-full-page-react-app
render_page()
Process settings and render the Generate Embed application.
public
render_page() : void
set_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : void
Parameters
- $options : array<string|int, mixed> = array()
enqueueReact()
Things we normally want to do before each render
protected
enqueueReact() : void
get_vars_for_react()
Pass data from PHP to React JavaScript environment.
protected
get_vars_for_react() : array<string|int, mixed>
Use this for one-time setup, things that are mostly static in PHP, but you need to send to JS.
Return values
array<string|int, mixed>initialize()
Configure the React entry point and its WordPress-to-React data filter.
protected
final initialize() : void
add_notification()
Queue a message for the React notification stack.
private
add_notification(string $severity, string $message) : void
Parameters
- $severity : string
- $message : string
get_container_id()
Get the saved deployment container ID with a safe legacy fallback.
private
get_container_id() : string
Return values
stringget_presentation()
Get the saved presentation with a safe fallback.
private
get_presentation() : string
Return values
stringis_valid_container_id()
Ensure the value can be used safely as an HTML container ID.
private
is_valid_container_id(string $container_id) : bool
Parameters
- $container_id : string
Return values
boolsave_settings()
Persist submitted deployment settings.
private
save_settings() : void