[wp-hackers] How do you get jQuery tabs working in Wordpress 2.8?

Heiko Rabe heiko.rabe at code-styling.de
Thu Jun 18 18:55:56 GMT 2009

It's very easy to write code that works for WP 2.7 and Wp 2.8 accourding 
to jQuery Tabs.
I wrote an article (sorry german only) but the essentials are this:

//jQuery UI 1.5.2 doesn’t expect tab ID’s at DIV, so we have to apply a 
hotfix instead
var *needs_jquery_hotfix* = (($.ui.version === undefined) || 
(parseInt($.ui.version.split(’.')[1]) < 7));
$("#tabs"+(*needs_jquery_hotfix* ? “>ul” : “”)).tabs({
//do you init stuff here

To test the UI instead of jQuery is the better way, because the tabs 
component inherits from rewritten jQuery widget class.
Also some more patches can be easly applied against a older UI version 
to work as it would be a 1.7+ version.


Andrew Ozz schrieb:
> Dylan Kuhn wrote:
>> I found by experimenting that in jQuery 1.3.x I have to select the 
>> container
>> of the tab UL, whereas in 1.2.x I had been selecting the UL itself.
> Yes, jQuery UI Tabs has some changes in UI 1.7.1 and is not used in 
> 2.8 any more. If you only need basic tab switching it takes only 
> couple of lines of js to do directly in jQuery and would be compatible 
> with both 1.2 and 1.3.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list