WordPress.org

Make WordPress Core

Changeset 51180


Ignore:
Timestamp:
06/18/2021 12:12:57 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Deactivate the Gutenberg plugin if its version is 10.7 or lower.

This avoids a fatal error due to WP_Block_Template class redeclaration when updating to WordPress 5.8 with an older version of Gutenberg activated.

Follow-up to [35582] for the REST API plugin.

Props hellofromTonya, oglekler, azaozz, desrosj, pbiron, jorbin, youknowriad, TimothyBlynJacobs, Clorith, markparnell.
See #53432.

File:
1 edited

Legend:

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

    r51134 r51180  
    13851385    _upgrade_422_remove_genericons();
    13861386
    1387     // Remove the REST API plugin if its version is Beta 4 or lower.
     1387    // Deactivate the REST API plugin if its version is 2.0 Beta 4 or lower.
    13881388    _upgrade_440_force_deactivate_incompatible_plugins();
     1389
     1390    // Deactivate the Gutenberg plugin if its version is 10.7 or lower.
     1391    _upgrade_580_force_deactivate_incompatible_plugins();
    13891392
    13901393    // Upgrade DB with separate request.
     
    16631666    }
    16641667}
     1668
     1669/**
     1670 * @ignore
     1671 * @since 5.8.0
     1672 */
     1673function _upgrade_580_force_deactivate_incompatible_plugins() {
     1674    if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '10.7', '<=' ) ) {
     1675        deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true );
     1676    }
     1677}
Note: See TracChangeset for help on using the changeset viewer.