LLMS_Assets::define( string $type, array[] $assets )
Define a list of assets by type so they can be enqueued or registered later.
Description Description
If an asset is already defined, redefining it will overwrite the previous definition.
Parameters Parameters
- $type
-
(string) (Required) Asset type. Accepts 'scripts' or 'styles'.
- $assets
-
(array[]) (Required) List of assets to define. The array key is the asset's handle. Each array value is an array of asset definitions.
Return Return
(array[]) Returns the updated list of defined assets.
Source Source
File: includes/class-llms-assets.php
* @return array[] Returns the updated list of defined assets. */ public function define( $type, $assets ) { if ( ! in_array( $type, array( 'scripts', 'styles' ), true ) ) { return false; } foreach ( $assets as $handle => $definition ) { $this->{$type}[ $handle ] = $definition; } return $this->$type;
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |