Action
rpress_pre_edit_customer
On this page
Fires before a customer record is updated from the admin Edit Customer form.
Runs in rpress_edit_customer() after the data has been filtered and sanitized, immediately before RPRESS_Customer::update() is called. Use it to validate or log the incoming values. The action does not allow cancelling the update.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$customer_id | int | The customer ID being edited. |
$customer_data | array | Sanitized customer fields (name, email, user_id). |
$address | array | Sanitized customer address fields. |
Example#
function my_log_customer_edit( $customer_id, $customer_data, $address ) {
error_log( sprintf( 'Customer %d edited, new email: %s', $customer_id, $customer_data['email'] ) );
}
add_action( 'rpress_pre_edit_customer', 'my_log_customer_edit', 10, 3 );
Source#
Fired from:
includes/admin/customers/customer-actions.php(line 102), inrpress_edit_customer()
See also#
Was this page helpful?
