Changeset 52165
- Timestamp:
- 11/15/2021 07:57:28 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/update-core.php
r52093 r52165 1402 1402 _upgrade_580_force_deactivate_incompatible_plugins(); 1403 1403 1404 // Deactivate the Gutenberg plugin if its version is 11.8 or lower. 1405 _upgrade_590_force_deactivate_incompatible_plugins(); 1406 1404 1407 // Upgrade DB with separate request. 1405 1408 /** This filter is documented in wp-admin/includes/update-core.php */ … … 1686 1689 1687 1690 /** 1691 * @access private 1688 1692 * @ignore 1689 1693 * @since 5.8.0 … … 1691 1695 function _upgrade_580_force_deactivate_incompatible_plugins() { 1692 1696 if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '10.7', '<=' ) ) { 1693 $deactivated_gutenberg['gutenberg'] = array( 1694 'plugin_name' => 'Gutenberg', 1695 'version_deactivated' => GUTENBERG_VERSION, 1696 'version_compatible' => '10.8', 1697 ); 1698 if ( is_plugin_active_for_network( 'gutenberg/gutenberg.php' ) ) { 1699 $deactivated_plugins = get_site_option( 'wp_force_deactivated_plugins', array() ); 1700 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg ); 1701 update_site_option( 'wp_force_deactivated_plugins', $deactivated_plugins ); 1702 } else { 1703 $deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() ); 1704 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg ); 1705 update_option( 'wp_force_deactivated_plugins', $deactivated_plugins ); 1706 } 1707 deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true ); 1697 _deactivate_gutenberg_when_incompatible_with_wp( '10.8' ); 1708 1698 } 1709 1699 } 1700 1701 /** 1702 * @access private 1703 * @ignore 1704 * @since 5.9.0 1705 */ 1706 function _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 ); 1735 } 1736 deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true ); 1737 }
Note: See TracChangeset
for help on using the changeset viewer.