Skip to content
Docs
Get RestroPress

Action

rpress_pre_edit_customer

Updated
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#

ParameterTypeDescription
$customer_idintThe customer ID being edited.
$customer_dataarraySanitized customer fields (name, email, user_id).
$addressarraySanitized 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), in rpress_edit_customer()

See also#

Was this page helpful?