Filter
rpress_should_process_refund
On this page
Filters whether RPRESS_Payment::process_refund should adjust stats for a refunded payment.
The default is true only when the payment was in the publish or revoked status and is now refunded. Return false to skip the refund processing, including the actions and the stats changes that follow. Custom payment types can use it to apply their own logic.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$process_refund | bool | Whether the refund should be processed. |
$payment | RPRESS_Payment | The payment being refunded. |
Return value#
bool. Whether to process the refund.
Example#
function my_should_process_refund( $process_refund, $payment ) {
if ( $payment->get_meta( '_my_skip_refund_stats', true ) ) {
return false;
}
return $process_refund;
}
add_filter( 'rpress_should_process_refund', 'my_should_process_refund', 10, 2 );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 1650), inRPRESS_Payment::process_refund()
See also#
Was this page helpful?
