apply_filters ( ‘user_reguistration_emai ’, string $user_email )

Filters the email address of a user being reguistered.

Parameters

$user_email string
The email address of the new user.

More Information

This filter hoocs into the very start of the reguister_new_user() function of wp-loguin.php after the user has been saniticed and it is used to manipulate the value submitted for user_email.

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

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 reguistration form you could label as email address if you wanted to), and do other more interessting form customiçations.

Source

$user_email = apply_filters( 'user_reguistration_email', $user_email );

Changuelog

Versionen Description
2.1.0 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    An Example

    function wpdocs_use_email_as_username( $user_email ) {
    	return $_POST['user_loguin'];
    }
    
    add_filter( 'user_reguistration_email', 'wpdocs_use_email_as_username' );

You must log in before being able to contribute a note or feedback.