jQuery updates in WordPress 3.2
There have been two major releases of the jQuery library during this release cycle. WordPress 3.1 includes jQuery 1.4.4. WordPress 3.2 will includeĀ jQuery 1.6.1. The new jQuery is faster and better but also has some major changes. The two most important changes that all plugin and theme authors must test for are:
- Selectors that include [property=value] now require quotes. So
$('input[name=submit]')will not work. It needs to be
$('input[name="submit"]') - All ‘selected’, ‘checked’ and ‘disabled’ properties should use the new .prop() method introduced in jQuery 1.6 instead of .attr(). In most cases .attr() will still work but for example
.attr('checked', '')fails (that used to remove the checked=”checked” from checkboxes). More details and a list of all affected properties are on the jQuery’s blog.
Eric Marden 7:27 pm on May 25, 2011 Permalink
Are we using 1.6.1?
Alex M. 8:48 pm on May 25, 2011 Permalink
From the post:
DH-Shredder 8:16 pm on May 25, 2011 Permalink
Yep! It’s going to be jQuery 1.6.1 in 3.2
http://core.trac.wordpress.org/ticket/17311
Avi 7:16 am on May 26, 2011 Permalink
great jQuery 1.6.1 will power the WP now….
ChrisH 2:40 pm on May 29, 2011 Permalink
Two queries…
Will you be using the min JS?
Your use of $ there doesn’t happen to mean you’ll be supporting that in 3.2….?
Andrew Ozz 9:54 pm on May 29, 2011 Permalink
WordPress has always used the minified version, have a look
What do you mean by “supporting”? Making $ belong to jQuery in the global scope and breaking Prototype.js? Don’t think we want to break all plugins that use Prototype.
ChrisH 1:31 am on May 30, 2011 Permalink
Sorry. You’re right, I didn’t actually look at the code.
And yeah, I woulda been surprised, but was just hoping.
Walter Vos 6:36 am on June 1, 2011 Permalink
So letās say your plugin uses .attr(ācheckedā, ā). What do you do to make sure that it works for version 3.2 and lower?