Asset
in package
Asset Module class.
Table of Contents
Properties
- $action_hook_enqueue : ActionHook
- ActionHook instance for the enqueue action.
- $action_hook_register : ActionHook
- ActionHook instance for the register action.
- $deps : array<string|int, string>
- Asset dependencies.
- $handle : string
- Asset handle.
- $register_only : array<string|int, mixed>|null
- Asset arguments.
- $src : string
- Asset source.
- $ver : string|bool
- Asset version.
Methods
- __toString() : string
- Custom toString magic method.
- initialize() : void
- Initializes the asset.
Properties
$action_hook_enqueue
ActionHook instance for the enqueue action.
protected
ActionHook
$action_hook_enqueue
ActionHook instance for the enqueue action.
Tags
$action_hook_register
ActionHook instance for the register action.
protected
ActionHook
$action_hook_register
ActionHook instance for the register action.
Tags
$deps
Asset dependencies.
protected
array<string|int, string>
$deps
An array of registered script handles this script depends on.
Tags
$handle
Asset handle.
protected
string
$handle
Name of the script. Should be unique.
Tags
$register_only
Asset arguments.
protected
array<string|int, mixed>|null
$register_only
Array or query string of arguments for registering a script.
Tags
$src
Asset source.
protected
string
$src
Full URL of the script, or path of the script relative to the WordPress root directory.
Tags
$ver
Asset version.
protected
string|bool
$ver
String specifying script version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is added.
Tags
Methods
__toString()
Custom toString magic method.
public
__toString() : string
Returns the asset as a JSON string.
Tags
Return values
string —JSON string.
initialize()
Initializes the asset.
protected
initialize() : void
Sets the action hooks and adds the asset to the registry.