Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

WooCommercePayments::is_connected()public staticWC 1.0

Check if WooCommerce Payments is connected.

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

Хуков нет.

Возвращает

true|false.

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

$result = WooCommercePayments::is_connected();

Код WooCommercePayments::is_connected() WC 7.1.0

public static function is_connected() {
	if ( class_exists( '\WC_Payments' ) ) {
		$wc_payments_gateway = \WC_Payments::get_gateway();
		return method_exists( $wc_payments_gateway, 'is_connected' )
			? $wc_payments_gateway->is_connected()
			: false;
	}

	return false;
}