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.
Method of the class: PaymentsProviders{}
No Hooks.
Returns
true|false. True if the payment gateway is a shell, false otherwise.
Usage
$PaymentsProviders = new PaymentsProviders(); $PaymentsProviders->is_shell_payment_gateway( $gateway ): bool;
- $gateway(WC_Payment_Gateway) (required)
- The payment gateway object.
PaymentsProviders::is_shell_payment_gateway() PaymentsProviders::is shell payment gateway code WC 10.7.0
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 . '_' ) );
}