WordPress.org

Make WordPress Core

Ticket #53432: 53432.1.diff

File 53432.1.diff, 1.1 KB (added by hellofromTonya, 3 months ago)

Invokes the upgrade function during update.

  • src/wp-admin/includes/update-core.php

    diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php
    index 6e8e3e270a..897f6e537b 100644
    a b function update_core( $from, $to ) { 
    13871387        // Remove the REST API plugin if its version is Beta 4 or lower.
    13881388        _upgrade_440_force_deactivate_incompatible_plugins();
    13891389
     1390        // Deactive the Gutenberg plugin if its version is 10.7 or earlier.
     1391        _upgrade_580_force_deactivate_incompatible_plugins();
     1392
    13901393        // Upgrade DB with separate request.
    13911394        /** This filter is documented in wp-admin/includes/update-core.php */
    13921395        apply_filters( 'update_feedback', __( 'Upgrading database…' ) );
    function _upgrade_440_force_deactivate_incompatible_plugins() { 
    16621665                deactivate_plugins( array( 'rest-api/plugin.php' ), true );
    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}