Automattic\WooCommerce\Internal\Admin\Settings
PaymentsProviders::is_shell_payment_gateway
Check if a payment gateway is a shell payment gateway.
A shell payment gateway is generally one that has no method title or description. This is used to identify gateways that are not intended for display in the admin UI.
Метод класса: PaymentsProviders{}
Хуков нет.
Возвращает
true|false. True if the payment gateway is a shell, false otherwise.
Использование
$PaymentsProviders = new PaymentsProviders(); $PaymentsProviders->is_shell_payment_gateway( $gateway ): bool;
- $gateway(WC_Payment_Gateway) (обязательный)
- The payment gateway object.
Код PaymentsProviders::is_shell_payment_gateway() PaymentsProviders::is shell payment gateway WC 10.9.4
public function is_shell_payment_gateway( WC_Payment_Gateway $gateway ): bool {
return ( empty( $gateway->get_method_title() ) && empty( $gateway->get_method_description() ) ) ||
// Special case for WooPayments gateways that are not the main one: their method title is "WooPayments",
// but their ID is made up of the main gateway ID and a suffix for the payment method.
( 'WooPayments' === $gateway->get_method_title() && str_starts_with( $gateway->id, WooPaymentsService::GATEWAY_ID . '_' ) );
}