Action
rpress_customer_post_attach_payment
On this page
Fires after a payment is attached to a customer.
Fires at the end of RPRESS_Customer::attach_payment(), after the payment_ids update and the stat increments. The first argument tells whether the update succeeded.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$payment_added | bool | Whether the payment IDs were updated successfully. |
$payment_id | int | The payment ID. |
$customer_id | int | The customer ID. |
$customer | RPRESS_Customer | The customer object. |
Example#
function my_customer_post_attach_payment( $payment_added, $payment_id, $customer_id, $customer ) {
if ( $payment_added ) {
update_post_meta( $payment_id, '_my_customer_id', $customer_id );
}
}
add_action( 'rpress_customer_post_attach_payment', 'my_customer_post_attach_payment', 10, 4 );
Source#
Fired from:
includes/class-rpress-customer.php(line 394), inRPRESS_Customer::attach_payment()
See also#
Was this page helpful?
