Skip to content
Docs
Get RestroPress

Action

rpress_payment_save

Updated
On this page

Fires from RPRESS_Payment::save for pending data keys that have no built-in handler.

RPRESS_Payment::save loops over the properties changed since the object was loaded and handles the standard ones itself. Any other key reaches this action so extensions can persist their own data. The key tells the callback which property was changed.

Parameters#

ParameterTypeDescription
$paymentRPRESS_PaymentThe payment being saved.
$keystringThe pending property name that has no built-in handler.

Example#

function my_save_payment_data( $payment, $key ) {
	if ( 'my_reference' === $key ) {
		$payment->update_meta( '_my_reference', $payment->my_reference );
	}
}
add_action( 'rpress_payment_save', 'my_save_payment_data', 10, 2 );

Source#

Fired from:

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

See also#

Was this page helpful?