WordPress.org

Forums

WooCommerce - excelling eCommerce
JQuery Migrate plugin for backward compatibility (1 post)

  1. Andy
    Member
    Posted 1 year ago #

    Hi.

    In new version plugin enqueue core version of JQuery if current version less than 1.8. Can you, please, add with future update also JQuery Migrate plugin to enqueue with core version of JQuery, for better backward compatibility.

    Something like:

    public function check_jquery() {
        global $wp_scripts;
    
        // Enforce minimum version of jQuery
        if ( ! empty( $wp_scripts->registered['jquery']->ver ) && ! empty( $wp_scripts->registered['jquery']->src ) && 0 >= version_compare( $wp_scripts->registered['jquery']->ver, '1.8' ) ) {
    		wp_deregister_script( 'jquery' );
    		wp_register_script( 'jquery', '/wp-includes/js/jquery/jquery.js', array(), '1.8' );
    		wp_enqueue_script( 'jquery' );
    		wp_enqueue_script( 'jquery-migrate' );
        }
    }

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.