Asset extends Component
Handles static assets.
Table of Contents
- __construct() : mixed
- Class constructor.
- add_image_sizes() : mixed
- Adds image sizes.
- add_script_attributes() : string
- Adds script attributes.
- enqueue_scripts() : mixed
- Enqueues scripts.
- enqueue_styles() : mixed
- Enqueues styles.
- boot() : mixed
- Bootstraps component properties.
- set_callbacks() : mixed
- Sets the action and filter callbacks.
- set_property() : mixed
- Sets a property value.
Methods
__construct()
Class constructor.
public
__construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
-
Component arguments.
Return values
mixed —add_image_sizes()
Adds image sizes.
public
add_image_sizes() : mixed
Return values
mixed —add_script_attributes()
Adds script attributes.
public
add_script_attributes(string $tag, string $handle) : string
Parameters
- $tag : string
-
Script tag.
- $handle : string
-
Script handle.
Return values
string —enqueue_scripts()
Enqueues scripts.
public
enqueue_scripts() : mixed
Return values
mixed —enqueue_styles()
Enqueues styles.
public
enqueue_styles() : mixed
Return values
mixed —boot()
Bootstraps component properties.
protected
boot() : mixed
Return values
mixed —set_callbacks()
Sets the action and filter callbacks.
protected
final set_callbacks(array<string|int, mixed> $callbacks) : mixed
Parameters
- $callbacks : array<string|int, mixed>
-
Callback arguments.
Return values
mixed —set_property()
Sets a property value.
protected
final set_property(string $name, mixed $value[, string $prefix = '' ]) : mixed
Parameters
- $name : string
-
Property name.
- $value : mixed
-
Property value.
- $prefix : string = ''
-
Method prefix.