Skip to content
Docs
Get RestroPress

Filter

rpress_gateway_admin_label

Updated
On this page

Filters the admin label of a payment gateway.

Runs in rpress_get_gateway_admin_label. The label comes from the registered gateway, or the gateway ID if it is unknown. For the manual gateway on an order screen with a zero amount, the label is changed to Test Payment before the filter runs.

Parameters#

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

Return value#

string. The admin label.

Example#

function my_gateway_admin_label( $label, $gateway ) {
	if ( 'cash_on_delivery' === $gateway ) {
		return __( 'Cash (rider collects)', 'my-plugin' );
	}
	return $label;
}
add_filter( 'rpress_gateway_admin_label', 'my_gateway_admin_label', 10, 2 );

Source#

Applied in:

  • includes/gateways/functions.php (line 131), in rpress_get_gateway_admin_label()

See also#

Was this page helpful?