user_registration_email WordPress Filter Hook

This hook allows you to specify the email that is sent to a user when they register for a new account on your Wordpress site. By default, the email will contain the username and password for the new account, but you can use this hook to customize the email to include additional information or a different message.

apply_filters( 'user_registration_email', string $user_email ) #

Filters the email address of a user being registered.


Parameters

$user_email

(string)The email address of the new user.


Top ↑

More Information

This filter hooks into the very start of the register_new_user() function of wp-login.php after the user has been sanitized and it is used to manipulate the value submitted for user_email.

As it is the very first filter to be called in the registration process it’s a reasonable (i.e. not really good but possible) place to manipulate user registration data in $_POST as well as the email field itself before that data is further processed.

This means that it can be used for instance to set the email address field to be the same as the username (which on your registration form you could label as email address if you wanted to), and do other more interesting form customizations.


Top ↑

Source

File: wp-includes/user.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.1.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
Show More