apply_filters( 'pre_user_login', string $sanitized_user_login )
Filters a username after it has been sanitized.
Description Description
This filter is called before the user is created or updated.
Parameters Parameters
- $sanitized_user_login
-
(string) Username after it has been sanitized.
Source Source
File: wp-includes/user.php
Changelog Changelog
Version | Description |
---|---|
2.0.3 | Introduced. |
User Contributed Notes 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:
Expand full source codeCollapse full source code