Filter
rpress_payment_amount
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#
| Parameter | Type | Description |
|---|---|---|
$amount | float | The payment total. |
$payment_id | int | The 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), inrpress_get_payment_amount()
See also#
Was this page helpful?
