sanitize_user WordPress Filter Hook
The sanitize_user hook is used to clean up a username before it is stored in the database. This is useful for ensuring that all usernames are lowercase, or that special characters are removed.
apply_filters( 'sanitize_user', string $username , string $raw_username , bool $strict ) #
Filters a sanitized username string.
Parameters
- $username
(string)Sanitized username.
- $raw_username
(string)The username prior to sanitization.
- $strict
(bool)Whether to limit the sanitization to specific characters.
Source
Changelog
Version | Description |
---|---|
2.0.1 | Introduced. |