Warning: This method has been deprecated. Block types register the scripts themselves instead.
Assets::register_block_script( string $script_name, string $handle = '', array $dependencies = array() )
Queues a block script in the frontend.
Description Description
Parameters Parameters
- $script_name
-
(Required) Name of the script used to identify the file inside build folder.
- $handle
-
(Optional) Provided if the handle should be different than the script name.
wc-
prefix automatically added.Default value: ''
- $dependencies
-
(Optional) An array of registered script handles this script depends on.
Default value: array()
Source Source
File: packages/woocommerce-blocks/src/Assets.php
Changelog Changelog
Version | Description |
---|---|
4.5.0 | Block types register the scripts themselves. |
2.9.0 | Made it so scripts are not loaded in admin pages. |
2.6.0 | Changed $name to $script_name and added $handle argument. |
2.3.0 | Introduced. |