WPDev.one
Core Function
View Source on Trac ↗

sanitize_user()

sanitize_user( mixed $username, mixed $strict = false )

Sanitizes a username, stripping out unsafe characters.

Parameters 2 required

Name / Type Description
$username
string

The username to be sanitized.

Required
bool

$strict Optional. If set to true, limits $username to specific characters. Default false.

Required

Return Value

(string)
The sanitized username, after passing through filters.

Function Information

Since Version
2.0.0
Source File
wp-includes/formatting.php
Advertisement