diff --git a/wp-includes/class-wp-script-modules.php b/wp-includes/class-wp-script-modules.php index b2413d0f24..6770597c1b 100644 --- a/wp-includes/class-wp-script-modules.php +++ b/wp-includes/class-wp-script-modules.php @@ -151,6 +151,18 @@ class WP_Script_Modules { unset( $this->enqueued_before_registered[ $id ] ); } + /** + * Removes a registered script module. + * + * @since 6.5.0 + * + * @param string $id The identifier of the script module. + */ + public function deregister( string $id ) { + unset( $this->registered[ $id ] ); + unset( $this->enqueued_before_registered[ $id ] ); + } + /** * Adds the hooks to print the import map, enqueued script modules and script * module preloads. diff --git a/wp-includes/script-modules.php b/wp-includes/script-modules.php index 2aff768bb3..f8efb9484b 100644 --- a/wp-includes/script-modules.php +++ b/wp-includes/script-modules.php @@ -112,3 +112,14 @@ function wp_enqueue_script_module( string $id, string $src = '', array $deps = a function wp_dequeue_script_module( string $id ) { wp_script_modules()->dequeue( $id ); } + +/** + * Deregisters the script module. + * + * @since 6.5.0 + * + * @param string $id The identifier of the script module. + */ +function wp_deregister_script_module( string $id ) { + wp_script_modules()->deregister( $id ); +} diff --git a/wp-includes/version.php b/wp-includes/version.php index af517defd0..24d2664786 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57592'; +$wp_version = '6.5-alpha-57593'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.