Action
rpress_customer_pre_set_primary_email
On this page
Fires before an email is set as the customer's primary email.
Fires in RPRESS_Customer::set_primary_email() after the address is validated, before it checks whether the address belongs to another customer. The method may still return false afterwards, so the primary email is not guaranteed to change.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$new_primary_email | string | The email address being made primary. |
$customer_id | int | The customer ID. |
$customer | RPRESS_Customer | The customer object. |
Example#
function my_customer_pre_set_primary_email( $new_primary_email, $customer_id, $customer ) {
error_log( 'Customer ' . $customer_id . ' primary email -> ' . $new_primary_email );
}
add_action( 'rpress_customer_pre_set_primary_email', 'my_customer_pre_set_primary_email', 10, 3 );
Source#
Fired from:
includes/class-rpress-customer.php(line 298), inRPRESS_Customer::set_primary_email()
See also#
Was this page helpful?
