Assets
in package
Enqueue the stylesheet and JavaScript for the frontend of the site.
.
Tags
Table of Contents
Constants
- GOOGLE_RECAPTCHA_SCRIPT_URL = 'https://www.google.com/recaptcha/api.js'
- Google reCAPTCHA script URL.
Properties
- $google_recaptcha_site_key : string
- Google reCAPTCHA site key.
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
Methods
- enqueue_assets() : void
- Enqueue the stylesheets and script for the public-facing side of the site.
- get_instance() : object
- Creates and/or returns the instance of this class.
- register_scripts() : void
- Register the JavaScript for the public-facing side of the site.
- register_styles() : void
- Register the stylesheets for the public-facing side of the site.
- __construct() : void
- Initialise the class.
Constants
GOOGLE_RECAPTCHA_SCRIPT_URL
Google reCAPTCHA script URL.
protected
string
GOOGLE_RECAPTCHA_SCRIPT_URL
= 'https://www.google.com/recaptcha/api.js'
Tags
Properties
$google_recaptcha_site_key
Google reCAPTCHA site key.
protected
string
$google_recaptcha_site_key
= ''
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
Methods
enqueue_assets()
Enqueue the stylesheets and script for the public-facing side of the site.
public
enqueue_assets() : void
- Enqueue the form stylesheet on single posts, 404 pages and search results pages only.
- Enqueue the form script on single posts only when comments are open.
Tags
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
register_scripts()
Register the JavaScript for the public-facing side of the site.
public
register_scripts() : void
- The asset must start with a leading slash. It is relative to the assets directory.
Tags
register_styles()
Register the stylesheets for the public-facing side of the site.
public
register_styles() : void
- The asset must start with a leading slash. It is relative to the assets directory.
Tags
__construct()
Initialise the class.
protected
__construct() : void