Skip to content
Docs
Get RestroPress

Filter

rpress_get_payment_fees

Updated
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#

ParameterTypeDescription
$feesarrayList of fee arrays.
$payment_idintID of the payment.
$paymentRPRESS_PaymentThe 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), in RPRESS_Payment::get_fees()

See also#

Was this page helpful?