Skip to content
Docs
Get RestroPress

Action

rpress_pre_setup_payment

Updated
On this page

Fires while an RPRESS_Payment object is being set up, before its properties are loaded.

Runs in RPRESS_Payment::setup_payment after the post has been confirmed as an rpress_payment, before any properties are populated. The payment object is therefore mostly empty at this point.

Parameters#

ParameterTypeDescription
$paymentRPRESS_PaymentThe payment object being set up.
$payment_idintID of the payment post.

Example#

function my_pre_setup_payment( $payment, $payment_id ) {
	delete_transient( 'my_payment_summary_' . $payment_id );
}
add_action( 'rpress_pre_setup_payment', 'my_pre_setup_payment', 10, 2 );

Notes#

Also runs again whenever the object is re-initialized, such as after a save.

Source#

Fired from:

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

See also#

Was this page helpful?