WordPress at Your Fingertips
function is not described

_upgrade_580_force_deactivate_incompatible_plugins() WP 5.8.0

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

null. Nothing.

Usage

_upgrade_580_force_deactivate_incompatible_plugins();

Changelog

Since 5.8.0 Introduced.

Code of _upgrade_580_force_deactivate_incompatible_plugins() WP 5.8.2

function _upgrade_580_force_deactivate_incompatible_plugins() {
	if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '10.7', '<=' ) ) {
		$deactivated_gutenberg['gutenberg'] = array(
			'plugin_name'         => 'Gutenberg',
			'version_deactivated' => GUTENBERG_VERSION,
			'version_compatible'  => '10.8',
		);
		if ( is_plugin_active_for_network( 'gutenberg/gutenberg.php' ) ) {
			$deactivated_plugins = get_site_option( 'wp_force_deactivated_plugins', array() );
			$deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg );
			update_site_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
		} else {
			$deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() );
			$deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg );
			update_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
		}
		deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true );
	}
}