apply_filters( 'pre_user_login', string $sanitized_user_login )
Filters a username after it has been sanitized.
Description
This filter is called before the user is created or updated.
Parameters
-
$sanitized_user_login
string -
Username after it has been sanitized.
Source
File: wp-includes/user.php
.
View all references
$pre_user_login = apply_filters( 'pre_user_login', $sanitized_user_login );
Changelog
Version | Description |
---|---|
2.0.3 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
This filter is run before a user is created and/or updated. The fact that all pre_user hooks are run in both conditions makes life a bit more complicated.
The filter is referenced in both wp-admin/user-new.php and wp-includes/user.php
Here’s an example of using it to make sure a newly created user has a nickname equal to the user’s first and last name: