Filter
rpress_should_update_payment_status
On this page
Filters whether RPRESS_Payment::update_status should change the payment status.
Applied after the new status was normalised (completed becomes publish) and found to differ from the old status. Return false to cancel the change; no status actions will fire.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$do_change | bool | True to proceed with the change. |
$payment_id | int | ID of the payment. |
$status | string | The new status. |
$old_status | string|false | The previous status, or false if none is recorded. |
Return value#
bool. Whether the status change is allowed.
Example#
function my_block_refund( $do_change, $payment_id, $status, $old_status ) {
if ( 'refunded' === $status && ! current_user_can( 'manage_options' ) ) {
return false;
}
return $do_change;
}
add_filter( 'rpress_should_update_payment_status', 'my_block_refund', 10, 4 );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 1459), inRPRESS_Payment::update_status()
See also#
Was this page helpful?
