wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_is_ascii_email › WordPress Function

Seit7.1.0
Veraltetn/v
wp_is_ascii_email ( $value, $email, $context )
Parameter: (3)
  • (string|false) $value The current filter value.
    Erforderlich: Ja
  • (string) $email The email address being checked.
    Erforderlich: Ja
  • (string|null) $context Validation context, or null for the initial call.
    Erforderlich: Ja
Gibt zurück:
  • (string|false) The email address if valid, false otherwise.
Definiert in:
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.


Quellcode

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;
}