Skip to content
Docs
Get RestroPress

Filter

rpress_gateway_checkout_label

Updated
On this page

Filters the checkout label of a payment gateway.

Runs in rpress_get_gateway_checkout_label. The label comes from the registered gateway, or the gateway ID if it is unknown. The manual gateway always uses Test Payment before the filter runs.

Parameters#

ParameterTypeDescription
$labelstringCheckout label for the gateway.
$gatewaystringGateway ID.

Return value#

string. The checkout label.

Example#

function my_gateway_checkout_label( $label, $gateway ) {
	if ( 'paypal' === $gateway ) {
		return __( 'PayPal or card', 'my-plugin' );
	}
	return $label;
}
add_filter( 'rpress_gateway_checkout_label', 'my_gateway_checkout_label', 10, 2 );

Source#

Applied in:

  • includes/gateways/functions.php (line 146), in rpress_get_gateway_checkout_label()

See also#

Was this page helpful?