wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_enqueue_script › WordPress Function

Since2.1.0
Deprecatedn/a
wp_enqueue_script ( $handle, $src = '', $deps = array(), $ver = false, $args = array() )
Parameters: (5)
  • (string) $handle Name of the script. Should be unique.
    Required: Yes
  • (string) $src Full URL of the script, or path of the script relative to the WordPress root directory. Default empty.
    Required: No
    Default: (empty)
  • (string[]) $deps Optional. An array of registered script handles this script depends on. Default empty array.
    Required: No
    Default: array()
  • (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: No
    Default: false
  • (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. @type string $strategy Optional. If provided, may be either 'defer' or 'async'. @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'. @type string $fetchpriority Optional. The fetch priority for the script. Default 'auto'. }
    Required: No
    Default: array()
See:
  • WP_Dependencies::add()
  • WP_Dependencies::add_data()
  • WP_Dependencies::enqueue()
Defined at:
Codex:
Change Log:
  • 6.3.0
  • 6.9.0

Enqueues a script.

Registers the script if $src provided (does NOT overwrite), and enqueues it.


Source

Soon...