WP_Script_Modules::dequeue()publicWP 6.5.0

Unmarks the script module so it will no longer be enqueued in the page.

Method of the class: WP_Script_Modules{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Script_Modules = new WP_Script_Modules();
$WP_Script_Modules->dequeue( $id );
$id(string) (required)
The identifier of the script module.

Changelog

Since 6.5.0 Introduced.

WP_Script_Modules::dequeue() code WP 6.7.1

public function dequeue( string $id ) {
	if ( isset( $this->registered[ $id ] ) ) {
		$this->registered[ $id ]['enqueue'] = false;
	}
	unset( $this->enqueued_before_registered[ $id ] );
}