Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

wp_register_script()

3 tags 1 category

wp_register_script() — Registers a new script. Registers a script to be enqueued later using the wp_enqueue_script() function.

Inputs: $handle (string): Name of the script. Should be unique. $src (string|false): Full URL of the script, or path of the script relative to the WordPress root directory. If source is set to false, script is an alias of other scripts it depends on. $deps (string[]): Optional. An array of registered script handles this script depends on. Default empty array. $ver (string|bool|null): 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. $args (array|bool): Optional. An array of extra args for the script. Default empty array. Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false. Field $strategy (string): Optional. If provided, may be either ‘defer’ or ‘async’. Field $in_footer (bool): Optional. Whether to print the script in the footer. Default ‘false’. Field $fetchpriority (string): Optional. The fetch priority for the script. Default ‘auto’. Field $module_dependencies (array): Optional. IDs for module dependencies loaded via dynamic import. Default empty array. For the full data format, see the $deps param of wp_register_script_module().

Returns bool: Whether the script has been registered. True on success, false on failure.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…