Assets::register_script( string $handle, string $src, array $deps = 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.

$src

(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()

$has_i18n

(Optional) Whether to add a script translation call to this file. Default 'true'.

Default value: true


Top ↑

Source Source

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


			

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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