LLMS_Assets::get( string $type, string $handle )
Retrieve an asset definition by type and handle
Description Description
Locates the asset by type and handle and merges a potentially impartial asset definition with default values from the get_defaults() method.
Parameters Parameters
- $type
-
(Required) The asset type. Accepts either "script" or "style".
- $handle
-
(Required) The asset handle.
Return Return
(array|false) An asset definition array or false if an asset definition could not be located.
- 'file_name'
(string) The file name of the asset. Excludes the path, suffix, and extension, eg: 'llms' for 'llms.js'. Defaults to the asset's handle. - 'base_url'
(string) The base URL used to locate the asset on the server. Defaults toLLMS_PLUGIN_URL. - 'path'
(string) The relative path to the asset within the plugin directory. Defaults toassets/jsfor scripts andassets/cssfor styles. - 'extension'
(string) The filename extension for the asset. Defaults to.jsfor scripts and.cssfor styles. - 'suffix'
(string) The file suffix for the asset, for example.minfor minified files. Defaults toLLMS_ASSETS_SUFFIX. - 'dependencies'
(string[]) An array of asset handles the asset depends on. These assets do not necessarily need to be assets defined by LifterLMS, for example WP Core scripts, such asjquery, can be used. - 'version'
(string) The asset version. Defaults toLLMS_VERSION. - 'package_id'
(string) An ID used to identify the originating plugin or theme that defined the asset. - 'in_footer'
(boolean) (Forscriptassets only) Whether or not the script should be output in the footer. Defaults totrue. - 'translate'
(boolean) (Forscriptassets only) Whether or not script translations should be set. Defaults tofalse. - 'rtl'
(boolean) (Forstyleassets only) Whether or not to automatically add RTL style data for the stylesheet. Defaults totrue. - 'media'
(boolean) (Forstyleassets only) The stylesheet's media type. Defaults toall.
Source Source
File: includes/class-llms-assets.php
Changelog Changelog
| Version | Description |
|---|---|
| 4.4.1 | Replace truthy check with an strict check against false to ensure assets defined with an empty array signifying all default values should be used. |
| 4.4.0 | Introduced. |