sanitize_email WordPress Filter Hook

The sanitize_email Wordpress hook is used to sanitize email addresses entered into Wordpress. This hook can be used to ensure that the email address is valid, and to clean up any extra characters that may have been entered. This hook is also used to lowercase the email address, so that it can be properly stored in the database.

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

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.


Top ↑

Parameters

$sanitized_email

(string)The sanitized email address.

$email

(string)The email address, as provided to sanitize_email().

$message

(string|null)A message to pass to the user. null if email is sanitized.


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