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

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

Хуков нет.

Возвращает

Массив. Items in 'incompatible' and 'uncertain' if plugins are incompatible by default with the feature; only items in 'incompatible' otherwise.

Использование

$PluginUtil = new PluginUtil();
$PluginUtil->get_items_considered_incompatible( $feature_id, $compatibility_info ): array;
$feature_id(строка) (обязательный)
Feature id.
$compatibility_info(массив) (обязательный)
Array containing "compatible', 'incompatible' and 'uncertain' keys.

Код PluginUtil::get_items_considered_incompatible() WC 9.3.3

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'];
}