[wp-trac] [WordPress Trac] #50919: wp_localize_script( 'jquery') has stopped working

WordPress Trac noreply at wordpress.org
Wed Aug 12 16:46:04 UTC 2020


#50919: wp_localize_script( 'jquery') has stopped working
-------------------------------+------------------------------
 Reporter:  rajeshsingh520     |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Script Loader      |     Version:  5.5
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by TimothyBlynJacobs):

 It looks like this happens because `wp_localize_script` rewrites `jquery`
 to `jquery-core`. In WordPress 5.4, `jquery` didn't have a script of its
 own, and was instead a wrapper for `jquery-core` and `jquery-migrate`. In
 #37110, this was changed so that `jquery` has a script of its own and
 doesn't reference `jquery-core` at all.

 An immediate fix for this would be dropping that rewrite in
 `wp_localize_script`, 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`. Particularly since we'll be reintroducing `jquery-migrate`
 in 5.6 when we update to jQuery 3.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50919#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list