SLPĀ® phpDocs

MySLP_Generate_Embed extends SLP_Base_ReactObject

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

Properties

$buildDir read-only

public string $buildDir

The build directory where the React script lives.

$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.

$wrapper_class

protected mixed $wrapper_class = 'react-wrapper generate-embed-component'

Methods

__construct()

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

extend_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
static

render()

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
string

get_presentation()

Get the saved presentation with a safe fallback.

private get_presentation() : string
Return values
string

is_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
bool
On this page

Search results