Automattic\WooCommerce\Utilities

PluginUtil::get_items_considered_incompatible()publicWC 1.0

Filter plugin/feature compatibility info, returning the names of the plugins/features that are considered incompatible. "Uncertain" information will be included or not depending on the value of the value of the 'plugins_are_incompatible_by_default' flag in the feature definition (default is true).

Method of the class: PluginUtil{}

No Hooks.

Return

Array. Items in 'incompatible' and 'uncertain' if plugins are incompatible by default with the feature; only items in 'incompatible' otherwise.

Usage

$PluginUtil = new PluginUtil();
$PluginUtil->get_items_considered_incompatible( $feature_id, $compatibility_info ): array;
$feature_id(string) (required)
Feature id.
$compatibility_info(array) (required)
Array containing "compatible', 'incompatible' and 'uncertain' keys.

PluginUtil::get_items_considered_incompatible() code WC 9.4.2

public function get_items_considered_incompatible( string $feature_id, array $compatibility_info ): array {
	$incompatible_by_default = wc_get_container()->get( FeaturesController::class )->get_plugins_are_incompatible_by_default( $feature_id );

	return $incompatible_by_default ?
		array_merge( $compatibility_info['incompatible'], $compatibility_info['uncertain'] ) :
		$compatibility_info['incompatible'];
}