wp_enqueue_script()
wp_enqueue_script(
mixed $handle,
mixed $src = '',
mixed $deps = array(),
mixed $ver = false,
mixed $args = array()
) Enqueues a script.
Parameters 4 required
| Name / Type | Description |
|---|---|
| $handle string | Name of the script. Should be unique. Required |
| string | $src Full URL of the script, or path of the script relative to the WordPress root directory. Default empty. Required |
| $deps string[] | Optional. An array of registered script handles this script depends on. Default empty array. |
| mixed | (string | bool | null) $ver Optional. String specifying script version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is added. Required |
| mixed | (array | bool) $args { Optional. An array of additional script loading strategies. Default empty array. Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false. Required |