Make WordPress Core

Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#60463 closed defect (bug) (fixed)

Script Modules API: Deregister script modules.

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

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.


10 months 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
10 months ago

  • Milestone changed from Awaiting Review to 6.5
  • Version set to trunk

#3 @gziolo
10 months ago

  • Owner set to gziolo
  • Resolution set to fixed
  • Status changed from new to 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:


10 months ago
#4

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

#5 @gziolo
10 months ago

  • Component changed from General to Script Loader

@cbravobernal commented on PR #6061:


10 months 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:


10 months 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.