Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Mark / t31os

    (@t31os_)

    The plugin already uses the google CDN for loading the jQuery UI themes and also uses the WordPress included jQuery UI and tabs scripts.

    Thanks for the suggestion all the same. ??

    Thread Starter webaware

    (@webaware)

    G’day Mark,

    That comment was going back some 6 months now, but at that stage at least your plugin wasn’t checking which version of jQuery was being bundled with WordPress, and was thus getting mismatched versions. Maybe you’ve fixed that since then.

    e.g. WordPress 3.5.1 bundles jQuery UI 1.9.2 and I think your plugin was loading a 1.8 release last time I looked.

    (I don’t actually use your plugin, back then I was sorting out a support question on one of my plugins where the user was putting a map in a tab using your plugin, so I’m not really in a position to check what it’s doing now)

    cheers,
    Ross

    Plugin Author Mark / t31os

    (@t31os_)

    The plugin does not load jQuery UI from an external library, it’s always used whichever one comes with WordPress, the only reference i make to an external library(namingly the Google CDN) is for the jQuery UI themes, which are purely CSS files.

    If there’s something i’m missing, please feel free to clarify further.

    Thread Starter webaware

    (@webaware)

    G’day Mark, I’m just saying that it’s a good idea to load the matching version of the CSS for the version of jQuery UI bundled with WordPress, because there can be some differences that the scripts rely on. e.g.

    jQuery UI 1.9.2 => CSS 1.9.2

    I took a look at your SVN current version and it’s loading a 1.10 version of the CSS. It probably works OK with jQuery UI 1.9.2, but might not with an earlier version (e.g. someone stuck back on WordPress 3.4.x loading an earlier version of jQuery UI). Best to match versions and avoid compatibility issues.

    cheers,
    Ross

    Plugin Author Mark / t31os

    (@t31os_)

    Usually i’d agree but the themes receive very minor and infrequent changes, i believe(for the moment) it makes sense to stick with the most current version(the current UI theme CSS is the most likely to display as intended, because tweaks and fixes, like this one, are in place where they wouldn’t be for older versions).

    Changelog for jQuery UI can be found here. If you have a look through each of the changelogs(had quick look myself) you’ll see there is very rarely any significant changes to the CSS files(no changes at all to the actual styling between some versions).

    You still have a valid point though and it’s certainly a consideration for me to load matching theme versions if there are backwards compatibility issues(comparing CSS across jQuery UI versions doesn’t show any significant changes that i can see). Whether WordPress holds version data on included libraries remains to be seen, if there’s no easy lookup for the version, i don’t think i’m prepared to bog down the plugin by literally reading the jQuery UI script line by line just to check the current version(or anything to that degree).

    I’ll go boot up the WAMP install and have a dig around to see if WordPress holds version data for included libraries.

    Thanks for the feedback.

    Thread Starter webaware

    (@webaware)

    G’day Mark,

    Take a read of this blog post, it tells you how to find the version number of the included jQuery UI script.

    cheers,
    Ross

    Plugin Author Mark / t31os

    (@t31os_)

    That’s pretty much the approach i’ve been testing .. ??

    public function get_wp_ui_version() {
    
    	global $wp_scripts;
    
    	if( !$wp_scripts instanceof WP_Scripts )
    		$wp_scripts = new WP_Scripts();
    
    	$jquery_ui_core = $wp_scripts->query( 'jquery-ui-core' );
    
    	if( !$jquery_ui_core instanceof _WP_Dependency )
    		return $this->ui_version;
    
    	if( !isset( $jquery_ui_core->ver ) )
    		return $this->ui_version;
    
    	return $jquery_ui_core->ver;
    }

    Use the plugin’s hardcoded version as a fallback.

    EDIT:
    Created another virtual host and plonked WordPress 3.3 on there with the current version of Post UI Tabs and the styling seems to all be ok using 1.10.2 CSS(WP 3.3 uses jQuery UI 1.8.16).

    This actually does highlight an issue in my recent update, in that jQuery UI prior to 1.9 used different methods to select and get the current tab, i updated the jQuery but didn’t think to provide backwards support to previous versions(going to work on a solution for that now).

    Thanks again for the feedback.

    Thread Starter webaware

    (@webaware)

    G’day Mark,

    Good stuff, and nice to hear that you’re supporting the older WP versions. I have to admit that I’m not putting effort into that myself, but I realise that some people can’t easily update from 3.3 yet due to other dependencies so I probably should support at least as far back as that. Food for thought.

    cheers,
    Ross

    Plugin Author Mark / t31os

    (@t31os_)

    In this specific case the backwards support i believe i need to provide is simply for older versions of jQuery UI, namingly any version prior to 1.9 which saw some of the tab functions replaced, namingly the select function and the selected option.

    WordPress 3.2 uses jQuery UI 1.7.3
    WordPress 3.3 uses jQuery UI 1.8.16
    and strangely WordPress 3.1 uses jQuery UI 1.8.9! (baffled as to why)

    I love that jQuery document all their changes across versions so well though, was a piece of cake finding all the information i needed to work from.

    Thread Starter webaware

    (@webaware)

    Ha, that’s weird (WP3.1). Yes, it’s nice when there’s actual documentation for what has changed, which I find refreshing with the jQuery and jQuery UI projects.

    cheers,
    Ross

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Post UI Tabs] Using the latest jQuery-UI CSS automatically’ is closed to new replies.