If your menus or widgets screens broke…
WordPress 3.0.5 was released at the same time as jQuery 1.5. Unfortunately, 1.5 has some backwards incompatible changes that appear to break a number of areas in the admin. The timing is awkward and it looks like it was us. It wasn’t.
There’s nothing we can do about this even for WordPress 3.1, which is freezing at jQuery 1.4.4.
If your theme deregisters jQuery and re-registers jQuery 1.5, then you’ll want to make sure that this change only applies for the frontend, i.e. ! is_admin(). (Or use the wp_enqueue_scripts hook, which only fires for the theme-side.) This might not be obvious — if you’re enqueueing the latest jQuery from, say, Google’s CDN, you’ll be getting 1.5 suddenly, and things will break.
Someone should put together a quick plugin that restores and enforces the bundled jQuery in the admin. I’ll do it later tonight if no one else does.
Reference: #16508 and numerous support forum threads.
Milan Dinić 10:20 pm on February 10, 2011 Permalink
This is why I’m always discouraging usage of wp_deregister_script and wp_register_script for jQuery from Google and instead encourage usage of Use Google Libraries plugin or its class which is the only right way to load jQuery and other libraries from Google.
Andrew Nacin 10:22 pm on February 10, 2011 Permalink
I think that plugin would cause the same problem. It looks like it’s still replacing the script in the admin.
Milan Dinić 10:38 pm on February 10, 2011 Permalink
Yes, it is replacing script in admin but it replaces with the same version as used in WordPress. See here.
It also check if is_ssl, strips ?ver= from URL, adds jquery.noconflict, and loads development version if
define('SCRIPT_DEBUG', false).I always promise to write a post on this subject but forget to do it. Will do that soon.
Otto 11:10 pm on February 10, 2011 Permalink
Correct, the Use Google Libraries plugin correctly handles version numbering. Specifically, it causes both admin and front to use http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js (with 3.1RC4). This prevents the breakage.
Jason Penney 4:52 pm on February 14, 2011 Permalink
The majority of the work on Use Google Libraries has been to make sure that it will do-the-right-thing and will not cause these kinds of issues (also, as demetris points out below, there’s a caching benefit to using the full version with Google’s servers). I do get a lot of requests to have it load the latest versions, but I’ve resisted adding it even as an option since I’m worried about it having unintended side-effects such as this.
If there are any areas like this where you feel it needs improvement I’d be happy to know.
Andrew Nacin 4:57 pm on February 14, 2011 Permalink
Yep, I stand corrected — it looks like great work.
demetris 11:08 pm on February 10, 2011 Permalink
Specifying only the major version is not a good idea in any case (or at least in any scenarios I can imagine). Not only things break, but you also get a very short cache period: 1 hour.
Specifying major + minor version (e.g.: 1.5) avoids API incompatibilities, but you only get 1 hour of caching again.
Specifying major + minor + maintenance (e.g.: 1.5.0) is the best option: In addition to avoiding incompatibilities, it also gets you one full year of caching.
demetris 11:09 pm on February 10, 2011 Permalink
I failed to mention: The above are true for the Google CDN. I don’t know how other public CDNs, like Microsoft’s, handle caching.
hakre 11:43 pm on February 10, 2011 Permalink
Re-freeze on 1.5 as a shortcut for WP 3.1. Should be a matter of hours.
Andrew Nacin 11:50 pm on February 10, 2011 Permalink
I don’t know what you’re referring to. jQuery 1.5 is not in WordPress 3.1. And I’m not sure what should be a matter of hours.
Ramoonus 11:50 am on February 12, 2011 Permalink
understanding his reply is a matter of hours
garyc40 12:17 pm on February 12, 2011 Permalink
From what I’ve seen so far, it seems like there’s some incompatibility between jQuery UI and jQuery 1.5. So there’s probably nothing WordPress can do right now until jQuery UI gets updated.
garyc40 12:19 pm on February 12, 2011 Permalink
Possibly a bug of jQuery 1.5 itself:
http://bugs.jquery.com/ticket/8123
http://bugs.jqueryui.com/ticket/6955
hakre 5:39 pm on February 12, 2011 Permalink
Looks like jQuery 1.5.1 fixes that .
Ashley 12:34 pm on February 15, 2011 Permalink
I have upgraded to 3.0.5 and I am loading Jquery 1.4.4. (via google api) and only on the (! is_admin) frontend.
I can’t order/reorder my wp nav (drag and drop) BUT have noticed the WP menu (left) open close functionality doent work on the menu order page but works elsewhere?
There seems to be something with this pages functionality, not google as I am loading whichever WP uses for Jquery backend by default?
I have also deactivated ALL plugins which made no difference either?
I also don’t know how to downgrade back to 3.0.4 – if anyone has this data and can post a link – thanks in advance. Though I would be greatful if someone can shed some light on this as it doen’t make sense.
Andrew Nacin 12:37 pm on February 15, 2011 Permalink
Hi Ashley,
The proper place for support is http://wordpress.org/support/ — to answer your question, downgrading means undoing some security enhancements (which is bad). It also won’t solve your problem. You probably have an unrelated JavaScript conflict. (Or try a force-refresh of your browser, to clear the cache.)
Anyway, check out the support forums, they’ll help you there.
Ashley 1:14 pm on February 15, 2011 Permalink
Thanks Andrew,
Good advice, I reset all Caches, rebooted server etc. logged out, did all the same again and eh voila, draggable menus back!
Kee p up the great work, steller product
Gustavo Bordoni 11:40 pm on February 26, 2011 Permalink
Hi Andrew,
I have a problem with the jQuery UI Tabs, and it throws the following error:
“uncaught exception: jQuery UI Tabs: Mismatching fragment identifier.”
I can’t solve this problem.
Thanks in Advance.
Ryan Boren 12:46 am on February 27, 2011 Permalink
Read more about the fragment identifier exception here. Recent versions of ui.tabs are stricter in what they will accept, and your theme/plugin will have to be changed.