SLP_Admin_Info
extends SLP_Base_ReactObject
in package
Base object used for React driven components.
Table of Contents
Properties
- $buildDir : string
- $buildURL : string
- $pageName : string
- $scriptAssetFile : string
- $scriptFile : string
- $scriptFilebase : string
- $scriptHandle : string
- $scriptURL : string
- $slplus : SLPlus
- $uses_slplus : bool
- $uses_slplus : bool
- $pageName : mixed
- $scriptFilebase : mixed
- $scriptHandle : mixed
- $slplus : mixed
- $uses_slplus : mixed
- $buildDir : mixed
- $buildURL : mixed
- $scriptAssetFile : mixed
- $scriptFile : mixed
- $scriptURL : mixed
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- get_instance() : SLPlus_BaseClass_Object
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- render() : void
- Render admin page
- set_properties() : mixed
- 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
- Do at invocation.
Properties
$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.
$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 asset PHP file.
$scriptFile read-only
public
string
$scriptFile
The fully qualified file name for the React script.
$scriptFilebase
public
string
$scriptFilebase
The name of the edit/view mode script file, default: script.js.
$scriptHandle
public
string
$scriptHandle
Both the WP handle for managing the react script and the build/
$scriptURL read-only
public
string
$scriptURL
The URL for the React script.
$slplus
public
SLPlus
$slplus
$uses_slplus
public
bool
$uses_slplus
Default false try to use SLPlus::get_instance() legacy models that use $this->slplus must set this to true.
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$pageName
protected
mixed
$pageName
= 'The Page Name'
$scriptFilebase
protected
mixed
$scriptFilebase
= 'script'
$scriptHandle
protected
mixed
$scriptHandle
= 'slp_infotab'
$slplus
protected
mixed
$slplus
$uses_slplus
protected
mixed
$uses_slplus
= \true
$buildDir
private
mixed
$buildDir
$buildURL
private
mixed
$buildURL
$scriptAssetFile
private
mixed
$scriptAssetFile
$scriptFile
private
mixed
$scriptFile
$scriptURL
private
mixed
$scriptURL
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
boolget_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_Objectrender()
Render admin page
public
render() : void
set_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : mixed
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()
Do at invocation.
protected
initialize() : void
..