wppaste
WordPress

apply_filters( 'sanitize_email', string $sanitized_email, string $email, string|null $message )

Since
2.8.0
Filters a sanitized email address.

Description

This filter is evaluated under several contexts, including 'email_too_short', 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits', 'domain_no_periods', 'domain_no_valid_subs', or no 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

$sanitized_emailstring
The sanitized email address.
$emailstring
The email address, as provided to sanitize_email().
$messagestring|null
A message to pass to the user. null if email is sanitized.

Where this hook fires · 8

  • wp-includes/formatting.php:3776sanitize_email()
  • wp-includes/formatting.php:3782sanitize_email()
  • wp-includes/formatting.php:3795sanitize_email()
  • wp-includes/formatting.php:3805sanitize_email()
  • wp-includes/formatting.php:3812sanitize_email()
  • wp-includes/formatting.php:3821sanitize_email()
  • wp-includes/formatting.php:3844sanitize_email()
  • wp-includes/formatting.php:3855sanitize_email()

Source code

		 * @since 2.8.0		 *		 * @param string $sanitized_email The sanitized email address.		 * @param string $email           The email address, as provided to sanitize_email().		 * @param string|null $message    A message to pass to the user. null if email is sanitized.		 */		return apply_filters( 'sanitize_email', '', $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( 'sanitize_email', '', $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.