[wp-trac] [WordPress Trac] #50919: wp_localize_script( 'jquery') has stopped working
WordPress Trac
noreply at wordpress.org
Wed Aug 12 20:11:39 UTC 2020
#50919: wp_localize_script( 'jquery') has stopped working
-------------------------------+---------------------
Reporter: rajeshsingh520 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.5.1
Component: Script Loader | Version: 5.5
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+---------------------
Comment (by TobiasBg):
Replying to [comment:4 TimothyBlynJacobs]:
> but it seems like there could be other scenarios where plugins/themes
are relying on `jquery-core` being actually enqueued. I think it'd make
the most sense to change `jquery` back to a wrapper for `jquery-core`.
This might indeed also helps with a related issue that I noticed today: If
a plugin previously had deliberately enqueued `jquery-core` (because its
JS files didn't need `jquery-migrate`), the jquery.js file might now
loaded twice (e.g. if another plugin or the theme is also enqueuing it).
This leads to issues if other jQuery plugins (like `jquery-ui` and
similar) are loaded, as the second copy of jquery.js then overrides the
extended jQuery JS object again.
Right now, this can be fixed by not enqueuing `jquery-core` directly, but
it takes away the possibility to deliberately not load `jquery-migrate`.
So, indeed, if `jquery` could be made a "wrapper" or "alias" for `jquery-
core` (until the new `jquery-migrate` is integrated), the just-described
problem and the original ticket problem should be solved.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50919#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list