wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_is_ascii_email › WordPress Function

Since7.1.0
Deprecatedn/a
wp_is_ascii_email ( $value, $email, $context )
Parameters: (3)
  • (string|false) $value The current filter value.
    Required: Yes
  • (string) $email The email address being checked.
    Required: Yes
  • (string|null) $context Validation context, or null for the initial call.
    Required: Yes
Returns:
  • (string|false) The email address if valid, false otherwise.
Defined at:
Codex:

Default is_email filter for databases that do not support Unicode (db charset is not utf8mb4).

Validates the email address using WP_Email_Address::from_string with Unicode disabled. Only acts when $context is null (which it is in the initial validation call); later rescue-context calls are passed through.


Source

function wp_is_ascii_email( $value, $email, $context ) {
	if ( null !== $context ) {
		return $value;
	}

	$result = WP_Email_Address::from_string( $email, 'ascii' );
	return $result ? $result->get_unicode_address() : false;
}