Action
rpress_update_payment_status
On this page
Fires after a payment's status has been changed.
Runs at the end of RPRESS_Payment::update_status, after the post was updated and the refund, failure or pending processing for the new status has run. RestroPress hooks its own completion, status logging and cache handling to this action.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$payment_id | int | ID of the payment. |
$status | string | The new status. |
$old_status | string|false | The previous status. |
Example#
function my_on_payment_status( $payment_id, $status, $old_status ) {
if ( 'publish' === $status ) {
update_post_meta( $payment_id, '_my_paid_at', time() );
}
}
add_action( 'rpress_update_payment_status', 'my_on_payment_status', 10, 3 );
Notes#
The paid status is stored as publish. rpress_complete_purchase is attached to this action at priority 100.
Source#
Fired from:
includes/payments/class-rpress-payment.php(line 1481), inRPRESS_Payment::update_status()
See also#
Was this page helpful?
