WC_Customer::set_email
Set customer's email.
Method of the class: WC_Customer{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Customer = new WC_Customer(); $WC_Customer->set_email( $value );
- $value(string) (required)
- Email.
Changelog
| Since 3.0.0 | Introduced. |
WC_Customer::set_email() WC Customer::set email code WC 10.6.2
public function set_email( $value ) {
if ( $value && ! is_email( (string) $value ) ) {
$this->error( 'customer_invalid_email', __( 'Invalid email address', 'woocommerce' ) );
}
$this->set_prop( 'email', sanitize_email( $value ) );
}