From 8c5f87daf7f572968bf8614406a1c708dd160685 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 13 Dec 2018 21:11:22 +0000 Subject: [PATCH] Upgrade/Install: Deactivate Gutenberg plugin on update to 5.0. Props mcsf. Merges [43765] to trunk. Fixes #45123. git-svn-id: https://develop.svn.wordpress.org/trunk@44125 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 23 +++++++++++++++++++++++ src/wp-includes/version.php | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index f8b871db49..82a6530e2c 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -793,6 +793,10 @@ function upgrade_all() { upgrade_460(); } + if ( $wp_current_db_version < 43764 ) { + upgrade_500(); + } + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -2069,6 +2073,25 @@ function upgrade_460() { } } +/** + * Executes changes made in WordPress 5.0.0. + * + * @ignore + * @since 5.0.0 + * + * @global int $wp_current_db_version Current database version. + */ +function upgrade_500() { + global $wp_current_db_version; + if ( $wp_current_db_version < 43764 ) { + // Allow bypassing Gutenberg plugin deactivation. + if ( defined( 'GUTENBERG_USE_PLUGIN' ) && GUTENBERG_USE_PLUGIN ) { + return; + } + deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true ); + } +} + /** * Executes network-level upgrade routines. * diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index d479d97724..3f51ddf122 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -20,7 +20,7 @@ $wp_version = '5.1-alpha-43677-src'; * * @global int $wp_db_version */ -$wp_db_version = 42836; +$wp_db_version = 43764; /** * Holds the TinyMCE version