Skip to content
Docs
Get RestroPress

Filter

rpress_payment_amount

Updated
On this page

Filters the total amount returned for a payment.

Runs at the end of rpress_get_payment_amount(), which returns the payment's total as a float. The filtered value is used by every caller of that function, including the formatted amount helpers.

Parameters#

ParameterTypeDescription
$amountfloatThe payment total.
$payment_idintThe payment (order) ID.

Return value#

float. The payment amount.

Example#

add_filter( 'rpress_payment_amount', 'my_round_payment_amount', 10, 2 );
function my_round_payment_amount( $amount, $payment_id ) {
	return round( $amount, 2 );
}

Source#

Applied in:

  • includes/payments/functions.php (line 1534), in rpress_get_payment_amount()

See also#

Was this page helpful?