Skip to content
Docs
Get RestroPress

Filter

rpress_gateway_supports

Updated
On this page

Filters the features supported by a payment gateway.

Runs in rpress_get_gateway_supports. The list is read from the supports key of the gateway in the enabled gateways list, and is empty when the gateway has none or is not enabled. The built-in PayPal gateway supports buy_now.

Parameters#

ParameterTypeDescription
$supportsarrayList of feature slugs the gateway supports.
$gatewaystringGateway ID.

Return value#

array. The supported feature slugs.

Example#

function my_gateway_supports( $supports, $gateway ) {
	if ( 'my_gateway' === $gateway && ! in_array( 'buy_now', $supports, true ) ) {
		$supports[] = 'buy_now';
	}
	return $supports;
}
add_filter( 'rpress_gateway_supports', 'my_gateway_supports', 10, 2 );

Source#

Applied in:

  • includes/gateways/functions.php (line 158), in rpress_get_gateway_supports()

See also#

Was this page helpful?