sanitize_user ( $username, $strict = false )
- (string) username The username to be sanitized.
- (bool) strict If set limits $username to specific characters. Default false.
- (string) The sanitized username, after passing through filters.
- Introduced in WordPress: 2.0.0
- Deprecated in WordPress: —
Sanitizes a username, stripping out unsafe characters.Removes tags, octets, entities, and if strict is enabled, will only keep
alphanumeric, _, space, ., -, @. After sanitizing, it passes the username,
raw username (the username in the parameter), and the value of $strict as
parameters for the Array filter.