WordPress.org

Ready to get started?Download WordPress

Forums

Showtime
Use of JQuery 1.8 may break other plugins (3 posts)

  1. professor99
    Member
    Posted 1 year ago #

    WordPress: Version 3.4.2
    Showtime 3.0
    Browser: Firefox 16.0.2

    Problem

    Use of JQuery 1.8 by the following code in showtime.php may break other plugins in WordPress 3.4.2 and earlier.

    function showtime_jQuery_method() {
        wp_deregister_script( 'jquery' );
        wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js');
        wp_enqueue_script( 'jquery' );
    }    
    
    add_action('wp_enqueue_scripts', 'showtime_jQuery_method');

    The following outlines one bug introduced by this though there may be others

    JQuery 1.8 omits the curCSS definition which was included inJQuery 1.7.2 as follows

    file: wp-includes/js/jquery/jquery.js?
    version: 1.7.2

    In this file there is the following line which is executed on editor load.

    f.curCSS=f.css

    In the unminified version of this file this reads as

    // DEPRECATED in 1.3, Use jQuery.css() instead
    jQuery.curCSS = jQuery.css;

    Omission of this line causes other problems in other JQuery scripts loaded by WordPress and other plugins.

    In particular as I outlined here http://wordpress.org/support/topic/insertedit-link-dialog-doesnt-show?replies=3#post-3305278 it may result in problems with JQueryUI which results in this case in one of the dialogs failing to display.

    Solution

    I currently have altered the code as follows which causes the default WordPress JQuery file wp-includes/js/jquery/jquery.js (version 1.7.2) to load

    function showtime_jQuery_method() {
    //    wp_deregister_script( 'jquery' );
    //    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js');
        wp_enqueue_script( 'jquery' );
    }    
    
    add_action('wp_enqueue_scripts', 'showtime_jQuery_method');

    This seems to have no ill effects on Showtime and fixes the problem with the WP User Frontend plugin I had.

    Alternatively you may set the version to 1.7.2 but I cant see why this code is needed given the default seems to work fine.

    Cheers
    The Professor

    http://wordpress.org/extend/plugins/showtime/

  2. Dave Navarro, Jr.
    Member
    Posted 1 year ago #

    Does the author never visit this forum?

  3. professor99
    Member
    Posted 1 year ago #

    Carter does visit this forum and we now are working on a development package that does address this and other issues + adds many new features. It should be available for alpha testing soon.

    Alternatively you can make the code change yourself if you experience this problem in the meantime.

    Cheers
    The Professor

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic