Make WordPress Core

Changeset 54789


Ignore:
Timestamp:
11/10/2022 12:20:48 PM (2 years ago)
Author:
hellofromTonya
Message:

Update/Install: Deactivate Gutenberg plugin version older than 14.1.

Resolves a fatal error due to get_template_hierarchy() due to incompatible older Gutenberg versions.

[54269] introduced this new function for 6.1. The function was introduced in Gutenberg 13.9.0. However, it was not guarded to protect the plugin from when the function was loaded in Core. Gutenberg 14.1.0 added the function_exists() guard to protect the plugin from the fatal error.

Minimum compatible version:
This commit changes the Gutenberg minimum compatible version number to 14.1. For versions older than 14.1, the plugin will deactivate when upgrading Core to 6.1 or newer.

Function rename:
Past commits renamed the upgrade function by changing Core's version number. This commit renames the function to be generic, i.e. _upgrade_core_deactivate_incompatible_plugins() and adopts the @since [reason] strategy to track historical changes to the function.

Follow-up to [54269], [52199], [52166], [52165], [51180].

Props namithjawahar, hellofromTonya, azaozz, desrosj, ironprogrammer.
Fixes #56985.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update-core.php

    r54730 r54789  
    14381438    _upgrade_440_force_deactivate_incompatible_plugins();
    14391439
    1440     // Deactivate the Gutenberg plugin if its version is 11.8 or lower.
    1441     _upgrade_590_force_deactivate_incompatible_plugins();
     1440    // Deactivate incompatible plugins.
     1441    _upgrade_core_deactivate_incompatible_plugins();
    14421442
    14431443    // Upgrade DB with separate request.
     
    16381638 * @access private
    16391639 * @ignore
    1640  * @since 5.9.0
     1640 * @since 5.8.0
     1641 * @since 5.9.0 The minimum compatible version of Gutenberg is 11.9.
     1642 * @since 6.1.1 The minimum compatible version of Gutenberg is 14.1.
    16411643 */
    1642 function _upgrade_590_force_deactivate_incompatible_plugins() {
    1643     if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '11.9', '<' ) ) {
     1644function _upgrade_core_deactivate_incompatible_plugins() {
     1645    if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '14.1', '<' ) ) {
    16441646        $deactivated_gutenberg['gutenberg'] = array(
    16451647            'plugin_name'         => 'Gutenberg',
    16461648            'version_deactivated' => GUTENBERG_VERSION,
    1647             'version_compatible'  => '11.9',
     1649            'version_compatible'  => '14.1',
    16481650        );
    16491651        if ( is_plugin_active_for_network( 'gutenberg/gutenberg.php' ) ) {
Note: See TracChangeset for help on using the changeset viewer.