Filter
rpress_is_gateway_active
On this page
Filters whether a payment gateway is active.
Runs in rpress_is_gateway_active after the gateway ID is looked up in the enabled gateways list. Return true or false to override the result for a specific gateway.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$ret | bool | True when the gateway is in the enabled list. |
$gateway | string | Gateway ID being checked. |
$gateways | array | Enabled gateways keyed by ID. |
Return value#
bool. Whether the gateway is active.
Example#
function my_is_gateway_active( $ret, $gateway, $gateways ) {
if ( 'cash_on_delivery' === $gateway && ! is_user_logged_in() ) {
return false;
}
return $ret;
}
add_filter( 'rpress_is_gateway_active', 'my_is_gateway_active', 10, 3 );
Source#
Applied in:
includes/gateways/functions.php(line 84), inrpress_is_gateway_active()
See also#
Was this page helpful?
