Tribe__Validate::email()
Validates and sanitizes an email address.
Source
File: src/Tribe/Validate.php
public function email( ) {
$candidate = trim( $this->value );
$this->result->valid = filter_var( $candidate, FILTER_VALIDATE_EMAIL );
if ( ! $this->result->valid ) {
$this->result->error = sprintf( esc_html__( '%s must be an email address.', 'tribe-common' ), $this->label );
} else {
$this->value = filter_var( trim( $candidate, FILTER_SANITIZE_EMAIL ) );
}
}
Changelog
| Version | Description |
|---|---|
| 4.7.4 | Introduced. |