Skip to content
Docs
Get RestroPress

Filter

rpress_edit_customer_info

Updated
On this page

Filters the sanitized customer fields before a customer record is updated from the admin.

Applied in rpress_edit_customer() after the name, email and linked user ID have been collected from the Edit Customer form. The array is then passed through sanitize_text_field on every value and given to RPRESS_Customer::update(). Add or change keys here to alter what is stored.

Parameters#

ParameterTypeDescription
$customer_dataarrayCustomer fields with keys 'name', 'email' and 'user_id'.
$customer_idintThe customer ID being edited.

Return value#

array. The customer data to save.

Example#

function my_edit_customer_info( $customer_data, $customer_id ) {
	$customer_data['name'] = ucwords( strtolower( $customer_data['name'] ) );
	return $customer_data;
}
add_filter( 'rpress_edit_customer_info', 'my_edit_customer_info', 10, 2 );

Notes#

Every value is run through sanitize_text_field() after this filter, so markup cannot be added here.

Source#

Applied in:

  • includes/admin/customers/customer-actions.php (line 98), in rpress_edit_customer()

See also#

Was this page helpful?