Skip to content
Docs
Get RestroPress

Action

rpress_before_payment_status_change

Updated
On this page

Fires just before a payment's status is changed.

Runs in RPRESS_Payment::update_status after rpress_should_update_payment_status allowed the change and before the post is updated.

Parameters#

ParameterTypeDescription
$payment_idintID of the payment.
$statusstringThe new status.
$old_statusstring|falseThe previous status.

Example#

function my_before_status_change( $payment_id, $status, $old_status ) {
	update_post_meta( $payment_id, '_my_previous_status', $old_status );
}
add_action( 'rpress_before_payment_status_change', 'my_before_status_change', 10, 3 );

Source#

Fired from:

  • includes/payments/class-rpress-payment.php (line 1462), in RPRESS_Payment::update_status()

See also#

Was this page helpful?