[wp-trac] [WordPress Trac] #47342: Get version of WordPress's jQuery

WordPress Trac noreply at wordpress.org
Wed May 22 18:09:56 UTC 2019


#47342: Get version of WordPress's jQuery
---------------------------+------------------------------
 Reporter:  mizzinc        |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  5.2.1
 Severity:  normal         |  Resolution:
 Keywords:  close          |     Focuses:
---------------------------+------------------------------

Comment (by garrett-eclipse):

 Hello,

 Just wanted to indicate that this results in WSOD in any case the theme
 was built to use that version for the CDN call.

 Had this happen on two sites we took over from another developer. Both
 were built with Roots Sage and implemented the Roots Soil module jQuery
 CDN. As they used this version string to call jQuery it returned as a 404
 and all reliant jQuery scripts failed leaving the page blank.

 I've flagged this to the developers of Roots Soil here -
 https://github.com/roots/soil/issues/226
 And provided a PR here - https://github.com/roots/soil/pull/227
 *I simply did a str_replace to strip the `-wp` suffix.

 I'm not saying this is the right way to go about this but wanted to flag
 that it will probably affect alot of Roots users and any other
 plugin/theme that uses a CDN service. Is it easy to run a regex search in
 the Plugin/Theme repos to flag any that use the
 `registered['jquery']->ver`.
 Note: This ticket used `$GLOBALS['wp_scripts']` but in Roots Soil it uses
 `wp_scripts()`.

 All the best

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


More information about the wp-trac mailing list