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


Top ↑

Source Source

File: packages/woocommerce-blocks/src/Assets/Api.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.