Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Frontend_Scripts::register_script( string $handle, string $path, string[] $deps = array('jquery'), string $version = WC_VERSION, boolean $in_footer = true )
Register a script for use.
Description Description
Parameters Parameters
- $handle
-
(Required) Name of the script. Should be unique.
- $path
-
(Required) Full URL of the script, or path of the script relative to the WordPress root directory.
- $deps
-
(Optional) An array of registered script handles this script depends on.
Default value: array('jquery')
- $version
-
(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.
Default value: WC_VERSION
- $in_footer
-
(Optional) Whether to enqueue the script before </body> instead of in the <head>. Default 'false'.
Default value: true
Source Source
File: includes/class-wc-frontend-scripts.php
private static function register_script( $handle, $path, $deps = array( 'jquery' ), $version = WC_VERSION, $in_footer = true ) { self::$scripts[] = $handle; wp_register_script( $handle, $path, $deps, $version, $in_footer ); }