is_email

Filters whether an email address is valid.

Description

apply_filters( 'is_email', (bool) $false, (string) $email, (string) $email_too_short ); 

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.

Parameters (3)

0. $false (bool) => false
Whether the email address has passed the is_email() checks. Default false.
1. $email (string)
The email address being checked.
2. $email_too_short (string) => 'email_too_short'
Context under which the email was tested.

Usage

To run the hook, copy the example below.
  1. $false = apply_filters( 'is_email', $false, $email, $email_too_short ); 
  2.  
  3. if ( !empty( $false ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the is_email callback 
  2. function filter_is_email( $false, $email, $email_too_short ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'is_email', 'filter_is_email', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'is_email', 'filter_is_email', 10, 3 ); 

Defined (9)

The filter is defined in the following location(s).

/wp-includes/formatting.php  
  1. return apply_filters( 'is_email', false, $email, 'email_too_short' ); 
  1. return apply_filters( 'is_email', false, $email, 'email_no_at' ); 
  1. return apply_filters( 'is_email', false, $email, 'local_invalid_chars' ); 
  1. return apply_filters( 'is_email', false, $email, 'domain_period_sequence' ); 
  1. return apply_filters( 'is_email', false, $email, 'domain_period_limits' ); 
  1. return apply_filters( 'is_email', false, $email, 'domain_no_periods' ); 
  1. return apply_filters( 'is_email', false, $email, 'sub_hyphen_limits' ); 
  1. return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' ); 
  1. return apply_filters( 'is_email', $email, $email, null );