Automattic\WooCommerce\Internal\Features

FeaturesController::handle_plugin_deactivation()privateWC 1.0

Handle the plugin deactivation hook.

Метод класса: FeaturesController{}

No Hooks.

Return

null. Nothing.

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.

Code of FeaturesController::handle_plugin_deactivation() WC 7.1.0

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 ) );

	}
}