Enqueues JavaScript.
Example Usage:
cms_enqueue_js('default', 'jquery-ui') cms_enqueue_js('plugin', 'select2-js', false, plugin_basename( dirname(FILE) )) cms_enqueue_js('theme', 'theme-slug/js/config.js')
- Full name:
cms_enqueue_js - Defined in:
cms/core/Shared/Helpers/core.php
Parameters
| Parameter | Type | Description |
|---|---|---|
$config |
string | Set whether to use default, plugin or theme config. |
$asset |
string|array | Relative path or URL to JavaScript(s) to enqueue. |
$minify |
bool|string | Enable js assets pipeline (concatenation and minification). |
Use a string that evaluates to true to provide the salt of the pipeline hash. |
||
| Use 'auto' to automatically calculate the salt from your assets last modification time. | ||
$slug |
string|null | Slug to set asset location. |
$location |
string | Javascript should be in head or footer. |
Return Value
void