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



is_email › WordPress Function

Seit0.71
Veraltetn/v
is_email ( $email, $deprecated = false )
Parameter: (2)
  • (string) $email Email address to verify.
    Erforderlich: Ja
  • (bool) $deprecated Deprecated.
    Erforderlich: Nein
    Standard: false
Gibt zurück:
  • (string|false) Valid email address on success, false on failure.
Definiert in:
Codex:

Verifies that an email is valid.

This accepts the addresses that matches the WHATWG specifications, i.e. what browsers use for <input type=email>. It also accepts some additional addresses. By default this accepts addresses like info@grå.org (also accepted by Firefox) <input type=email>. You can disable Unicode support by using the wp_is_ascii_email filter instead of wp_is_unicode_email, which is the default.


Quellcode

function is_email( $email, $deprecated = false ) {
	if ( ! empty( $deprecated ) ) {
		_deprecated_argument( __FUNCTION__, '3.0.0' );
	}

	/**
	 * Filters whether an email address is valid.
	 *
	 * This filter is evaluated under several different contexts, such as
	 * 'local_invalid_chars', 'domain_no_periods', or no specific context.
	 * Filters registered on this hook perform the actual validation; the
	 * default filter is registered in default-filters.php.
	 *
	 * @since 2.8.0
	 *
	 * @param string|false $is_email The email address if successfully passed the is_email() checks, false otherwise.
	 * @param string       $email    The email address being checked.
	 * @param string|null  $context  Context under which the email was tested, or null for the initial call.
	 */
	return apply_filters( 'is_email', false, $email, null );
}