Registers the script module if no script module with that script module identifier has already been registered.
$idstringrequired
$srcstringoptional
$depsarrayoptional
...$0 string|arrayid key with the script module identifier, and can contain an import key with either static or dynamic. By default, dependencies that don’t contain an import key are considered static.id stringimport stringstatic or dynamic. Defaults to static.Default:array()
$versionstring|false|nulloptional
Default:false
function wp_register_script_module( string $id, string $src, array $deps = array(), $version = false ) {
wp_script_modules()->register( $id, $src, $deps, $version );
}
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_register_script_module