Opened 17 months ago
Closed 16 months ago
#59302 closed enhancement (fixed)
Update script registration in default themes to use new function signature
Reported by: | flixos90 | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch |
Focuses: | performance | Cc: |
Description
This ticket is broken out of #58634, just to capture the work for updating the default theme calls to wp_register_script()
and wp_enqueue_script()
separately, given there is already a PR https://github.com/WordPress/wordpress-develop/pull/5073 that encompasses all of them.
The main ticket can then continue to be used to also update core's own usage accordingly.
cc @joemcgill
Change History (7)
#2
@
17 months ago
@flixos90 Was this tested in WordPress 6.2-. These themes can and are used in older versions of WordPress?
#3
@
16 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
Generally WP tries to keep bundled themes compatible with the WordPress version in which they were introduced. As an example of this, 2011 checks the block pattern functions exist prior to calling them.
I think these changes and those in #59316 will need to be modified to account for the older function signature.
I've reopened this to work on a PR.
#4
@
16 months ago
@peterwilsoncc Where specifically is the commit not compatible with the older WordPress versions? The old versions expect a boolean, and a non empty array is interpreted as true. That was considered in the implementation, so I don't see where there's an incompatibility. Could you please clarify the concern?
#5
@
16 months ago
@flixos90 It may have come from the follow up ticket but in 2011 one of the files was unintentionally moved from the header to footer. However, choosing to pass around the incorrect type doesn't seem like a great idea.
As I say, I'm working through a PR at the moment and will attach it to the ticket once it's ready for review.
#6
@
16 months ago
- Keywords changes-requested added
From my point of view, you are trying to solve a problem where there is none. We have 7 days before the Beta 1, and I would have preferred to move this ticket into 6.5 for further discussion.
#7
@
16 months ago
- Keywords changes-requested removed
- Resolution set to fixed
- Status changed from reopened to closed
Per the discussion in https://github.com/WordPress/wordpress-develop/pull/5196, closing this again. There is misalignment on how the changed signature should be approached in themes, however that is not a functional concern. The ticket can be reopened if there are other concerns.
There was one actual bug found as part of the discussion which was fixed in [56569]. As a result, all script changes were audited again, and other than that one, there are no breaking changes from the original commits.
In 56526: