WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/13/2018 09:11:22 PM (3 years ago)
Author:
desrosj
Message:

Upgrade/Install: Deactivate Gutenberg plugin on update to 5.0.

Props mcsf.

Merges [43765] to trunk.

Fixes #45123.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/includes/upgrade.php

    r43571 r44125  
    794794    }
    795795
     796    if ( $wp_current_db_version < 43764 ) {
     797        upgrade_500();
     798    }
     799
    796800    maybe_disable_link_manager();
    797801
     
    20712075
    20722076/**
     2077 * Executes changes made in WordPress 5.0.0.
     2078 *
     2079 * @ignore
     2080 * @since 5.0.0
     2081 *
     2082 * @global int $wp_current_db_version Current database version.
     2083 */
     2084function upgrade_500() {
     2085    global $wp_current_db_version;
     2086    if ( $wp_current_db_version < 43764 ) {
     2087        // Allow bypassing Gutenberg plugin deactivation.
     2088        if ( defined( 'GUTENBERG_USE_PLUGIN' ) && GUTENBERG_USE_PLUGIN ) {
     2089            return;
     2090        }
     2091        deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true );
     2092    }
     2093}
     2094
     2095/**
    20732096 * Executes network-level upgrade routines.
    20742097 *
Note: See TracChangeset for help on using the changeset viewer.