Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

WooCommercePayments::is_requested()public staticWC 1.0

Check if the plugin was requested during onboarding.

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

Хуков нет.

Возвращает

true|false.

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

$result = WooCommercePayments::is_requested();

Код WooCommercePayments::is_requested() WC 7.1.0

public static function is_requested() {
	$profiler_data       = get_option( OnboardingProfile::DATA_OPTION, array() );
	$product_types       = isset( $profiler_data['product_types'] ) ? $profiler_data['product_types'] : array();
	$business_extensions = isset( $profiler_data['business_extensions'] ) ? $profiler_data['business_extensions'] : array();

	$subscriptions_and_us = in_array( 'subscriptions', $product_types, true ) && 'US' === WC()->countries->get_base_country();
	return in_array( 'woocommerce-payments', $business_extensions, true ) || $subscriptions_and_us;
}