Method | Description | |
---|---|---|
add_script_data ( Inpsyde\MultilingualPress\Asset\Script | string $script, string $object_name, array $data ) : Inpsyde\MultilingualPress\Asset\Script | null | Adds the given data to the given script, and handles it in case the script has been enqueued already. | |
enqueue_script ( Inpsyde\MultilingualPress\Asset\Script | string $script, boolean $in_footer = true ) : boolean | Enqueues the script with the given handle. | |
enqueue_script_with_data ( Inpsyde\MultilingualPress\Asset\Script | string $script, string $object_name, array $data, boolean $in_footer = true ) : boolean | Enqueues the script with the given handle. | |
enqueue_style ( Inpsyde\MultilingualPress\Asset\Style | string $style ) : boolean | Enqueues the style with the given handle. | |
get_script ( string $handle ) : Inpsyde\MultilingualPress\Asset\Script | Returns the script with the given handle. | |
get_style ( string $handle ) : Inpsyde\MultilingualPress\Asset\Style | Returns the style with the given handle. | |
register_script ( Inpsyde\MultilingualPress\Asset\Script $script ) : static | Register the given script. | |
register_style ( Inpsyde\MultilingualPress\Asset\Style $style ) : static | Register the given style. |
Method | Description | |
---|---|---|
enqueue ( callable $callback ) : void | Either executes the given callback or hooks it to the appropriate enqueue action, depending on the context. | |
get_enqueue_action ( ) : string | Returns the appropriate action for enqueueing assets. | |
handle_script_data ( Inpsyde\MultilingualPress\Asset\Script $script ) : void | Handles potential data that has been added to the script after it was enqueued, and then clears the data. |
public add_script_data ( Inpsyde\MultilingualPress\Asset\Script | string $script, string $object_name, array $data ) : Inpsyde\MultilingualPress\Asset\Script | null | ||
$script | Inpsyde\MultilingualPress\Asset\Script | string | Script object or handle. |
$object_name | string | The name of the JavaScript variable holding the data. |
$data | array | The data to be made available for the script. |
return | Inpsyde\MultilingualPress\Asset\Script | null | Script object if it exists, null if not. |
public enqueue_script ( Inpsyde\MultilingualPress\Asset\Script | string $script, boolean $in_footer = true ) : boolean | ||
$script | Inpsyde\MultilingualPress\Asset\Script | string | Script object or handle. |
$in_footer | boolean | Optional. Enqueue in the footer? Defaults to true. |
return | boolean | Whether or not the script was enqueued successfully. |
public enqueue_script_with_data ( Inpsyde\MultilingualPress\Asset\Script | string $script, string $object_name, array $data, boolean $in_footer = true ) : boolean | ||
$script | Inpsyde\MultilingualPress\Asset\Script | string | Script object or handle. |
$object_name | string | The name of the JavaScript variable holding the data. |
$data | array | The data to be made available for the script. |
$in_footer | boolean | Optional. Enqueue in the footer? Defaults to true. |
return | boolean | Whether or not the script was enqueued successfully. |
public enqueue_style ( Inpsyde\MultilingualPress\Asset\Style | string $style ) : boolean | ||
$style | Inpsyde\MultilingualPress\Asset\Style | string | Style object or handle. |
return | boolean | Whether or not the style was enqueued successfully. |
public get_script ( string $handle ) : Inpsyde\MultilingualPress\Asset\Script | ||
$handle | string | Script handle. |
return | Inpsyde\MultilingualPress\Asset\Script | Script object. |
public register_script ( Inpsyde\MultilingualPress\Asset\Script $script ) : static | ||
$script | Inpsyde\MultilingualPress\Asset\Script | Script object. |
return | static | Asset manager instance. |
public register_style ( Inpsyde\MultilingualPress\Asset\Style $style ) : static | ||
$style | Inpsyde\MultilingualPress\Asset\Style | Style object. |
return | static | Asset manager instance. |