React_Tab implements Registerable
A special tab that enqueues assets to load a react js powered app.
Override the output method to specify the dom element where the app will be rendered.
Interfaces, Classes and Traits
- Registerable
Table of Contents
- $file_name : string
- Name of the file that will be enqueued.
- $json_accessor : string
- The name of the constant that holds the json data for the frontend.
- $section_name : string
- Name of the section.
- $plugin : Licensed_Plugin
- Plugin instance.
- __construct() : mixed
- Get things started.
- assets() : void
- Hook assets needed for this specific tab only.
- get_json() : array<string|int, mixed>
- Get json data for the app.
- output() : void
- Output the dom element where the react app will render.
- register() : void
- Hook into WP.
Properties
$file_name
Name of the file that will be enqueued.
public
string
$file_name
Name only, without the extension.
$json_accessor
The name of the constant that holds the json data for the frontend.
public
string
$json_accessor
$section_name
Name of the section.
public
string
$section_name
Needed so that react assets are loaded only on this specific section.
$plugin
Plugin instance.
private
Licensed_Plugin
$plugin
Methods
__construct()
Get things started.
public
__construct(Licensed_Plugin $plugin) : mixed
Parameters
- $plugin : Licensed_Plugin
Return values
mixed —assets()
Hook assets needed for this specific tab only.
public
assets() : void
Return values
void —get_json()
Get json data for the app.
public
abstract get_json() : array<string|int, mixed>
Return values
array<string|int, mixed> —output()
Output the dom element where the react app will render.
public
abstract output() : void
Return values
void —register()
Hook into WP.
public
register() : void