WordPress 3.5.1 landed about 3 weeks ago, since then I have had several emails, direct messages and contact requests for fixing different site-related issues, such as:
- I cannot drag widgets on my Widgets page
- My TinyMCE is not displaying on the Posts page
- My theme/plugin dialogs are broken
- My X functionality (say slider) behaves in a weird way
….has no method ‘curCSS’ – jquery-ui.js
Running through the Google results, I hit the jQuery bug tracker and the red light directed me to the ‘version incompatibility’ direction. Browsing two broken sites at the same time and running through their code, they were both deregistering either jquery (ugh!) or jquery-ui (nevertheless ugh).
There is a jQuery UI version that includes all the fancy stuff in one script file – the core script, dialogs, numerous effects, pregressbar, datepicker, autocomplete, accordion, tabs… This is not the case in core, for performance reasons mostly:
Theme developers and other innocent people are unaware of what is needed for them to run their proper say slider and try to deregister all the weird core stuff and include their own online/local jQuery UI version. However, version numbers are incrementing with time, so are the deprecated functions and the incompatibility between jQuery and jQuery UI. At the end you end up with a broken site (sometimes the entire frontend goes nuts, blank page only) due to this.
In addition to that more articles on the proper jQuery UI usage in WordPress in both the WordPress.org forums and StackOverflow/StackExchange are related to including a remote version of the script from a CDN or a local copy of the full jQuery UI. I won’t even link to them as they are just not right.
The wp_enqueue_script function has a clear guide for including jquery-ui related scripts, this is:
Don’t dequeue or deregister jquery OR jquery-ui. It’s been pretty critical for the past 3 weeks for too many sites following directions online and it won’t get different with time.