• Resolved Frank

    (@frankswift)


    Hi there,

    I forgot to ask one remaining question, currently our theme forces us to use an old version of jQuery which means the image uploader doesn’t work. If I force it to use the most updated jQuery like so:

    function include_default_jquery() {
    	wp_deregister_script('jquery');
    	wp_enqueue_script('jquery', site_url() . '/wp-includes/js/jquery/jquery.js', array(), null, true);
    }
    add_action('wp_enqueue_scripts', 'include_default_jquery', 5000);

    It fixes the issue but causes our theme to break. ?? We’re stuck with this theme until we rebuild the website though.

    Is there a way to load updated version of jQuery ONLY for WPAdverts in the meantime?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    hmm i understand you need the recent jQuery only for the page with [adverts_add] as only the file upload field is not compatible with the old jQuery?

    If so then you can try loading the default jQuery only when on page with [adverts_add] like this

    
    function include_default_jquery() {
      if( ! is_page( 1000 ) ) {
        return;
      }
      wp_deregister_script('jquery');
      wp_enqueue_script('jquery', site_url() . '/wp-includes/js/jquery/jquery.js', array(), null, true);
    }
    add_action('wp_enqueue_scripts', 'include_default_jquery', 5000);
    

    Just replace 1000 with an actual ID of the page with [adverts_add] shortcode.

    Thread Starter Frank

    (@frankswift)

    This was what I needed, just a quickie fix until we can finally upgrade to a theme that actually works. Thank you! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Image Uploader Broken (Using Old jQuery)’ is closed to new replies.