WordPress.org

Make WordPress Core

Ticket #54405: 54405.diff

File 54405.diff, 3.3 KB (added by hellofromTonya, 2 months ago)

Removes unnecessary _upgrade_580_force_deactivate_incompatible_plugins() AND fixes the GB version comparison to trigger at < 11.8.

  • 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 aa59a71592..63538751ae 100644
    a b function update_core( $from, $to ) { 
    13981398        // Deactivate the REST API plugin if its version is 2.0 Beta 4 or lower.
    13991399        _upgrade_440_force_deactivate_incompatible_plugins();
    14001400
    1401         // Deactivate the Gutenberg plugin if its version is 10.7 or lower.
    1402         _upgrade_580_force_deactivate_incompatible_plugins();
    1403 
    14041401        // Deactivate the Gutenberg plugin if its version is 11.8 or lower.
    14051402        _upgrade_590_force_deactivate_incompatible_plugins();
    14061403
    function _upgrade_440_force_deactivate_incompatible_plugins() { 
    16871684        }
    16881685}
    16891686
    1690 /**
    1691  * @access private
    1692  * @ignore
    1693  * @since 5.8.0
    1694  */
    1695 function _upgrade_580_force_deactivate_incompatible_plugins() {
    1696         if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '10.7', '<=' ) ) {
    1697                 _deactivate_gutenberg_when_incompatible_with_wp( '10.8' );
    1698         }
    1699 }
    1700 
    17011687/**
    17021688 * @access private
    17031689 * @ignore
    17041690 * @since 5.9.0
    17051691 */
    17061692function _upgrade_590_force_deactivate_incompatible_plugins() {
    1707         if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '11.8', '<=' ) ) {
    1708                 _deactivate_gutenberg_when_incompatible_with_wp( '11.9' );
    1709         }
    1710 }
    1711 
    1712 /**
    1713  * Deactivates the Gutenberg plugin when its version is incompatible.
    1714  *
    1715  * @access private
    1716  * @ignore
    1717  * @since 5.9.0
    1718  *
    1719  * @param string $compatible_version The version of Gutenberg plugin that is compatible.
    1720  */
    1721 function _deactivate_gutenberg_when_incompatible_with_wp( $compatible_version ) {
    1722         $deactivated_gutenberg['gutenberg'] = array(
    1723                 'plugin_name'         => 'Gutenberg',
    1724                 'version_deactivated' => GUTENBERG_VERSION,
    1725                 'version_compatible'  => $compatible_version,
    1726         );
    1727         if ( is_plugin_active_for_network( 'gutenberg/gutenberg.php' ) ) {
    1728                 $deactivated_plugins = get_site_option( 'wp_force_deactivated_plugins', array() );
    1729                 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg );
    1730                 update_site_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
    1731         } else {
    1732                 $deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() );
    1733                 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg );
    1734                 update_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
     1693        if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '11.9', '<' ) ) {
     1694                $deactivated_gutenberg['gutenberg'] = array(
     1695                        'plugin_name'         => 'Gutenberg',
     1696                        'version_deactivated' => GUTENBERG_VERSION,
     1697                        'version_compatible'  => '11.9',
     1698                );
     1699                if ( is_plugin_active_for_network( 'gutenberg/gutenberg.php' ) ) {
     1700                        $deactivated_plugins = get_site_option( 'wp_force_deactivated_plugins', array() );
     1701                        $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg );
     1702                        update_site_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
     1703                } else {
     1704                        $deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() );
     1705                        $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg );
     1706                        update_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
     1707                }
     1708                deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true );
    17351709        }
    1736         deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true );
    17371710}