WordPress.org

Make WordPress Core

Changeset 48753


Ignore:
Timestamp:
08/07/2020 04:49:24 PM (7 weeks ago)
Author:
SergeyBiryukov
Message:

Script Loader: Add a temporary jquery-migrate-compat-5.5 script handle.

This is intended as an easy way for plugins and themes to still be able to load jQuery with jQuery Migrate in WordPress 5.5.

Once jQuery is updated to 3.x, this temporary script handle will be removed. This means plugins and themes still using it at that point will fail to load their scripts (as a dependency will be missing), but will not cause "fatal errors" breaking the rest of JS.

Follow-up to [48323], [48324].

Props azaozz, desrosj, apedog, Clorith, jorbin.
Fixes #37110.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r48573 r48753  
    723723    $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.12.4-wp' );
    724724    $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.4.1' );
     725
     726    // Backward compatibility: Makes it easy for plugins and themes to enqueue jQuery with jQuery Migrate in WordPress 5.5.
     727    // Note: This script handle will most likely be removed in WordPress 5.6 or when jQuery is updated to the latest version.
     728    // Then plugins and themes that are still relying on it will stop functioning.
     729    $scripts->add( 'jquery-migrate-compat-5.5', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.4-wp' );
    725730
    726731    // Full jQuery UI.
Note: See TracChangeset for help on using the changeset viewer.