wppaste
WordPress

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

Since
2.8.0
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.

Compatibility

WordPress
since 2.8.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$is_emailstring|false
The email address if successfully passed the is_email() checks, false otherwise.
$emailstring
The email address being checked.
$contextstring
Context under which the email was tested.

Where this hook fires · 9

  • wp-includes/formatting.php:3562is_email()
  • wp-includes/formatting.php:3568is_email()
  • wp-includes/formatting.php:3580is_email()
  • wp-includes/formatting.php:3589is_email()
  • wp-includes/formatting.php:3595is_email()
  • wp-includes/formatting.php:3604is_email()
  • wp-includes/formatting.php:3612is_email()
  • wp-includes/formatting.php:3618is_email()
  • wp-includes/formatting.php:3624is_email()

Source code

		 * @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       $context  Context under which the email was tested.		 */		return apply_filters( 'is_email', false, $email, 'email_too_short' );	} 	// Test for an @ character after the first position.	if ( false === strpos( $email, '@', 1 ) ) {		/** This filter is documented in wp-includes/formatting.php */		return apply_filters( 'is_email', false, $email, 'email_no_at' );

Changelog

Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.