WordPress.org

Support

Support » Plugins and Hacks » WP UI - Tabs, Accordions, Sliders » [Plugin: WP UI – Tabs, Accordions, Sliders] Regarding custom code for Google's jQwery API

[Plugin: WP UI – Tabs, Accordions, Sliders] Regarding custom code for Google's jQwery API

  • I would like to use this code to use Google’s jQwery API directly :

    //Making jQuery Google API
    function modify_jquery() {
    	if (!is_admin()) {
    		// comment out the next two lines to load the local copy of jQuery
    		wp_deregister_script('jquery');
    		wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', false, '1.4.4');
    		wp_enqueue_script('jquery');
    	}
    }
    add_action('init', 'modify_jquery');

    As the tabs on pages created with your plugin view-able by every user (Guest,editor,admin etc.) , am I need to change the ((!is_admin()) role to ‘read’ capability ?

    http://wordpress.org/extend/plugins/wp-ui/

Viewing 1 replies (of 1 total)
  • Plugin Author kavingray

    @kavingray

    Hi there,

    You can definitely do so, but i recommend using the recent jQuery version, >= 1.6.

    //Making jQuery Google API
    function modify_jquery() {
    	if (!is_admin()) {
    	wp_deregister_script('jquery');
    	wp_enqueue_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js', false, '1.6.4');
    	}
    }
    add_action('init', 'modify_jquery');

    As for the tabs, the script is included on Viewer-facing end. You will have to set the capabilities manually for different posts. Assigning capabilities role to jQuery is probably not a good idea.

    On the admin end the script is only included with the plugin options page. If you want to use the tabs on other admin pages, you will have enqueue them in admin_init or admin_print_footer_scripts, accordingly.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP UI – Tabs, Accordions, Sliders] Regarding custom code for Google's jQwery API’ is closed to new replies.
Skip to toolbar