wp_register_script_module()
wp_register_script_module( string $id, string $src, array $deps = array(), mixed $version = false ) Registers the script module if no script module with that script module
Parameters 4 required
| Name / Type | Description |
|---|---|
| string | $id The identifier of the script module. Should be unique. It will be used in the final import map. Required |
| string | $src Optional. Full URL of the script module, or path of the script module relative to the WordPress root directory. If it is provided and the script module has not been registered yet, it will be registered. Required |
| array | $deps { Optional. List of dependencies. Required |
| mixed | (string | false | null) $version Optional. String specifying the script module version number. Defaults to false. It is added to the URL as a query string for cache busting purposes. If $version is set to false, the version number is the currently installed WordPress version. If $version is set to null, no version is added. Required |