Support » Plugin: WooCommerce » JQuery Migrate plugin for backward compatibility

  • 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.

  • The topic ‘JQuery Migrate plugin for backward compatibility’ is closed to new replies.