Function: validate_username

validate_username( string $username )

Checks whether a username is valid.

Parameters

Name Type(s) Default Value Description
$username string

Username.

Returns

boolean

Whether username given is valid

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.