is_email WordPress Filter Hook

The is_email Wordpress hook is a great way to ensure that a user's email address is valid. This hook can be used to validate an email address before it is stored in a database or sent to a third-party service.

apply_filters( 'is_email', string|false $is_email, string $email, string $context ) #

Filters whether an email address is valid.


Description

This filter is evaluated under several different contexts, such as ’email_too_short’, ’email_no_at’, ‘local_invalid_chars’, ‘domain_period_sequence’, ‘domain_period_limits’, ‘domain_no_periods’, ‘sub_hyphen_limits’, ‘sub_invalid_chars’, or no specific context.


Top ↑

Parameters

$is_email

(string|false)The email address if successfully passed the is_email() checks, false otherwise.

$email

(string)The email address being checked.

$context

(string)Context under which the email was tested.


Top ↑

Source

File: wp-includes/formatting.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More