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
This commit is contained in:
Jonathan Desrosiers 2018-12-13 21:11:22 +00:00
parent afa6771c23
commit 8c5f87daf7
2 changed files with 24 additions and 1 deletions

View File

@ -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.
*

View File

@ -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