Make WordPress Core


Ignore:
Timestamp:
02/12/2024 12:58:53 PM (2 years ago)
Author:
gziolo
Message:

Script Modules API: Add deregister module function

It was impossible to deregister a script module. It is changing to avoid problems for extenders that want to override any Core script module.

Fixes #60463.
Props cbravobernal, gziolo, mukesh27, youknowriad.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-modules.php

    r57503 r57593  
    113113    wp_script_modules()->dequeue( $id );
    114114}
     115
     116/**
     117 * Deregisters the script module.
     118 *
     119 * @since 6.5.0
     120 *
     121 * @param string $id The identifier of the script module.
     122 */
     123function wp_deregister_script_module( string $id ) {
     124    wp_script_modules()->deregister( $id );
     125}
Note: See TracChangeset for help on using the changeset viewer.