Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#60463 closed defect (bug) (fixed)

Script Modules API: Deregister script modules.

Reported by: cbravobernal Owned by: gziolo
Priority: normal Milestone: 6.5
Component: Script Loader Version: 6.5
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

Right now is impossible to deregister a script module. This can cause problems for extenders that want to override any Core script module.

It will eventually happen in Gutenberg once 6.5 is out.

Change History (7)

This ticket was mentioned in ​PR #6061 on ​WordPress/wordpress-develop by ​@cbravobernal.


3 years ago
#1

  • Keywords has-patch has-unit-tests added

Trac ticket: https://core.trac.wordpress.org/ticket/60463

Right now is impossible to deregister a script module. This can cause problems for extenders that want to override any Core script module.

It will eventually happen in Gutenberg once 6.5 is out. We already had dequeue, but also, being consistent with script_register, style_register, there should be a script_module_register.

#2 @cbravobernal
3 years ago

  • Milestone Awaiting Review → 6.5
  • Version → trunk

#3 @gziolo
3 years ago

  • Owner set to gziolo
  • Resolution → fixed
  • Status new → closed

In 57593:

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.

​@gziolo commented on ​PR #6061:


3 years ago
#4

Committed with https://core.trac.wordpress.org/changeset/57593. I'm still open to changing the function or method names.

#5 @gziolo
3 years ago

  • Component General → Script Loader

​@cbravobernal commented on ​PR #6061:


3 years ago
#6

Committed with https://core.trac.wordpress.org/changeset/57593. I'm still open to changing the function or method names.

If we want to keep consistency with scripts and styles, we need to rename all $id with $handle and deregister() with remove()

​@gziolo commented on ​PR #6061:


3 years ago
#7

If we want to keep consistency with scripts and styles, we need to rename all $id with $handle and deregister() with remove()

Let's continue the discussion on WordPress Trac. Commented https://core.trac.wordpress.org/ticket/56313#comment:79.

Note: See TracTickets for help on using tickets.