Api::register_script( string $handle, string $relative_src, array $dependencies = array(), bool $has_i18n = true )
Registers a script according to wp_register_script
, additionally loading the translations for the file.
Description Description
Parameters Parameters
- $handle
-
(Required) Name of the script. Should be unique.
- $relative_src
-
(Required) Relative url for the script to the path from plugin root.
- $dependencies
-
(Optional) An array of registered script handles this script depends on. Default empty array.
Default value: array()
- $has_i18n
-
(Optional) Whether to add a script translation call to this file. Default: true.
Default value: true
Source Source
File: packages/woocommerce-blocks/src/Assets/Api.php
Changelog Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |