function validate_username( $username ) {}

Checks whether an username is valid.


  • string $username: Username.

Return values

returns:Whether username given is valid

Defined filters

  • validate_username
    apply_filters( 'validate_username', $valid, $username )

Source code

function validate_username( $username ) {

	$sanitized = sanitize_user( $username, true );

	$valid = ( $sanitized == $username );

	return apply_filters( 'validate_username', $valid, $username );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: