Skip to content
Docs
Get RestroPress

Action

rpress_setup_payment

Updated
On this page

Fires after an RPRESS_Payment object has been fully set up.

Runs at the end of RPRESS_Payment::setup_payment, once all standard properties are loaded. Extensions can attach their own properties to the object here.

Parameters#

ParameterTypeDescription
$paymentRPRESS_PaymentThe populated payment object.
$payment_idintID of the payment post.

Example#

function my_setup_payment( $payment, $payment_id ) {
	$payment->my_reference = get_post_meta( $payment_id, '_my_reference', true );
}
add_action( 'rpress_setup_payment', 'my_setup_payment', 10, 2 );

Notes#

Also runs after save(), which calls setup_payment again.

Source#

Fired from:

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

See also#

Was this page helpful?