Automattic\WooCommerce\Internal\Features

FeaturesController::handle_plugin_deactivation()privateWC 1.0

Handle the plugin deactivation hook.

Method of the class: FeaturesController{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->handle_plugin_deactivation( $plugin_name ): void;
$plugin_name(string) (required)
Name of the plugin that has been deactivated.

FeaturesController::handle_plugin_deactivation() code WC 9.3.3

private function handle_plugin_deactivation( $plugin_name ): void {
	unset( $this->compatibility_info_by_plugin[ $plugin_name ] );

	foreach ( array_keys( $this->compatibility_info_by_feature ) as $feature ) {
		$compatibles = $this->compatibility_info_by_feature[ $feature ]['compatible'];
		$this->compatibility_info_by_feature[ $feature ]['compatible'] = array_diff( $compatibles, array( $plugin_name ) );

		$incompatibles = $this->compatibility_info_by_feature[ $feature ]['incompatible'];
		$this->compatibility_info_by_feature[ $feature ]['incompatible'] = array_diff( $incompatibles, array( $plugin_name ) );
	}
}