Filter
rpress_get_payment_fees
On this page
Filters the list of fees returned by RPRESS_Payment::get_fees.
Applied to the fees of a payment after they were filtered by type. Each fee array has an added id key that holds the fee's index in the stored fees.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$fees | array | List of fee arrays. |
$payment_id | int | ID of the payment. |
$payment | RPRESS_Payment | The payment object. |
Return value#
array. The fees to return.
Example#
function my_get_payment_fees( $fees, $payment_id, $payment ) {
return array_filter( $fees, function ( $fee ) {
return ! empty( $fee['amount'] );
} );
}
add_filter( 'rpress_get_payment_fees', 'my_get_payment_fees', 10, 3 );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 1338), inRPRESS_Payment::get_fees()
See also#
Was this page helpful?
