Automattic\WooCommerce\Internal\Admin\WCPayPromotion

Init::can_show_promotion()public staticWC 1.0

Checks if promoted gateway can be registered.

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

Хуков нет.

Возвращает

true|false. If promoted gateway should be registered.

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

$result = Init::can_show_promotion();

Код Init::can_show_promotion() WC 9.6.2

public static function can_show_promotion() {
	// Don't show if WooPayments is enabled.
	if ( class_exists( '\WC_Payments' ) ) {
		return false;
	}

	// Don't show if there is no WooPayments promotion spec.
	$wc_pay_spec = self::get_wc_pay_promotion_spec();
	if ( ! $wc_pay_spec ) {
		return false;
	}

	return true;
}