Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

WooCommercePayments::is_supported()public staticWC 1.0

Check if the store is in a supported country.

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

Хуков нет.

Возвращает

true|false.

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

$result = WooCommercePayments::is_supported();

Код WooCommercePayments::is_supported() WC 7.1.0

public static function is_supported() {
	$suggestions              = Suggestions::get_suggestions();
	$suggestion_plugins       = array_merge(
		...array_filter(
			array_column( $suggestions, 'plugins' ),
			function( $plugins ) {
				return is_array( $plugins );
			}
		)
	);
	$woocommerce_payments_ids = array_search( 'woocommerce-payments', $suggestion_plugins, true );
	if ( false !== $woocommerce_payments_ids ) {
		return true;
	}
	return false;
}