Make WordPress Core

Opened 7 months ago

Closed 7 months ago

Last modified 6 months ago

#61086 closed enhancement (fixed)

Script Modules: Hooks are not registered in wp-admin

Reported by: jonsurrell's profile jonsurrell Owned by: jonsurrell's profile jonsurrell
Milestone: 6.6 Priority: normal
Severity: normal Version: 6.5
Component: Script Loader Keywords: has-patch has-dev-note
Focuses: javascript Cc:

Description

Script Modules cannot be used in wp-admin. The necessary hooks are registered on wp_head or wp_footer, but should also be registered for the admin variants so that modules can be used from wp-admin.

Change History (13)

This ticket was mentioned in PR #6452 on WordPress/wordpress-develop by @jonsurrell.


7 months ago
#1

  • Keywords has-patch added

#2 @johnbillion
7 months ago

#60596 was marked as a duplicate.

#3 @johnbillion
7 months ago

  • Component changed from General to Script Loader
  • Milestone changed from Awaiting Review to Future Release
  • Version set to 6.5

#4 @jonsurrell
7 months ago

Thanks @johnbillion. I'll surface this context from you had in #60596 from the original ticket:

From https://core.trac.wordpress.org/ticket/56313#comment:49:

This feature only works on the front end, not within the wp-admin area, is this intentional?

It's not. Feel free to add a new ticket to add hooks for the admin.

#5 @jonsurrell
7 months ago

This blocks #61087. The Interactivity API depends on a Script Module so will not be usable in wp-admin until this is address.

#9 @gziolo
7 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 58126:

Script Modules: Hooks are not registered in wp-admin

Script Modules cannot be used in wp-admin. The necessary hooks are registered on wp_head or wp_footer, but should also be registered for the admin variants so that modules can be used from wp-admin.

Fixes #61086.
Props jonsurrell, cbravobernal, gziolo.

#11 @kebbet
7 months ago

Please milestone in 6.6 @gziolo or @jonsurrell

#12 @gziolo
7 months ago

  • Milestone changed from Future Release to 6.6

#13 @jonsurrell
6 months ago

  • Keywords needs-dev-note added

This does not need a full dev note, but it would be good to mention in release notes something like the following:

Script Modules can now be used in WP Admin. Before WordPress 6.6 Script Modules were only available on the frontend.

#14 @jonsurrell
6 months ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.