Make WordPress Core

Tagged: jQuery Toggle Comment Threads | Keyboard Shortcuts

  • Andrew Nacin 6:58 pm on December 17, 2012 Permalink
    Tags: , jQuery   

    The release cycle for WordPress 3.6 isn’t going to start until January, but we can of course start to drop in some early things before then. (This worked out nicely before the start of 3.5.)

    With that in mind, I have added jQuery 1.9 Beta 1 to trunk. It comes with a migration plugin for deprecated/removed features, and this migration plugin issues warnings in the console so we may fix them. Yes, we are likely to ship the migration plugin in 3.6 final; that’s why it exists. But for now, we should aim to fix anything not only outright broken in core, but also any warnings. (There are a lot of them.)

    For more, see the jQuery announcement post and the WordPress core Trac ticket, #22975.

    A side note: If you are using the WordPress Beta Tester plugin and wish to go back to the 3.5 branch, you can do so by changing the update stream setting from “Bleeding edge nightlies” (which is currently 3.6-alpha) to “Point release nightlies” (which is currently 3.5.1-alpha) and then downgrade. Of course, we’re happy to have you testing the 3.6 branch, which will be kept fairly stable throughout its development.

     
    • Eric Mann 2:51 am on December 18, 2012 Permalink | Log in to Reply

      I like the idea of the migration plugin … but I’m hesitant shipping any library that includes “Beta” in its version number. What’s to say parts of the API won’t change by the time 1.9 is finalized? Not to mention the possibility of shipping bugs with our own release…

      • Japh 3:13 am on December 18, 2012 Permalink | Log in to Reply

        Most likely something that’s beta now, will be stable by the time we’re ready to ship it. It makes more sense than going with the current stable and shipping that even after it’s out of date, or switching further through the dev cycle and not taking full advantage of new features.

      • Andrew Nacin 5:06 am on December 18, 2012 Permalink | Log in to Reply

        Sorry, I should have mentioned that jQuery 1.9 is due out in January, well before 3.6 would even be in beta.

        We strive to always ship the latest of packaged external libraries. By being good citizens and dropping pre-release packages into our own trunk, we contribute greatly to the upstream project while also ensuring there *won’t* be bugs with our own release.

    • moebiusmania 9:05 pm on December 27, 2012 Permalink | Log in to Reply

      hi, there is any possibilities of having the $ alias for jQuery by default in 3.6?

      • Andrew Nacin 3:44 pm on January 10, 2013 Permalink | Log in to Reply

        No, likely not. jQuery.noConflict() — used for historical reasons because of potential conflicts with other libraries, primarily Prototype — also happens to enforce better code. You can still use $ in code, you just have to be smarter about it:

        jQuery(document).ready( function($) {
           // You can use $ in here
        });
        

        Or:

        (function($) {
           // You can use $ in here
        })(jQuery);
        
  • Ryan Boren 3:16 am on May 7, 2011 Permalink
    Tags: 32compat, jQuery   

    Just a heads up. WP trunk uses jQuery 1.5.2. 1.5.2 no longer allows selectors of the form [property=value]. These selectors now require quotes: [property="value"]. Unquoted values will result in “uncaught exception: Syntax error, unrecognized expression: [property=value]“. Check your plugins against 1.5.2.

     
  • Andrew Nacin 10:07 pm on February 10, 2011 Permalink
    Tags: jQuery   

    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 | Log in to Reply

      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 | Log in to Reply

        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 | Log in to Reply

          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 | Log in to Reply

          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 | Log in to Reply

          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 | Log in to Reply

          Yep, I stand corrected — it looks like great work. :-)

    • demetris 11:08 pm on February 10, 2011 Permalink | Log in to Reply

      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 | Log in to Reply

        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 | Log in to Reply

      Re-freeze on 1.5 as a shortcut for WP 3.1. Should be a matter of hours.

    • garyc40 12:17 pm on February 12, 2011 Permalink | Log in to Reply

      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.

    • Ashley 12:34 pm on February 15, 2011 Permalink | Log in to Reply

      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 | Log in to Reply

        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 | Log in to Reply

          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 | Log in to Reply

      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 | Log in to Reply

        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.

  • Ryan Boren 5:59 am on August 9, 2008 Permalink
    Tags: jQuery   

    Updated jQuery UI to 1.5.2.

     
  • Mark Jaquith 12:29 am on June 30, 2008 Permalink
    Tags: auto-suggest, jQuery,   

    Tag auto-suggest now works for more than just the first tag. Before, you had to hit “enter” and send each tag down below if you wanted to use auto-suggest, because once you typed a comma, auto-suggest would stop working. Super-lame. Now it works like you think it should.

     
  • Ryan Boren 7:46 pm on June 27, 2008 Permalink
    Tags: jQuery   

    Updated to jQuery UI 1.5.1

     
  • Ryan Boren 6:34 pm on May 21, 2008 Permalink
    Tags: jQuery   

    Updated jQuery and jQuery UI to the latest from the jQuery trunk.

     
  • Ryan Boren 12:25 am on February 19, 2008 Permalink
    Tags: jQuery,   

    Timestamp editing is now in the post box area and disclosed through a jQuery slide down.

     
  • Ryan Boren 7:16 pm on February 8, 2008 Permalink
    Tags: jQuery   

    Updated trunk to the recently released jQuery 1.2.3

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel