wpseek.com
				A WordPress-centric search engine for devs and theme authors
			validate_username › WordPress Function
Since2.0.1
Deprecatedn/a
› validate_username ( $username )
| Parameters: | 
 | 
| Returns: | 
 | 
| Defined at: | 
 | 
| Codex: | |
| Change Log: | 
 | 
Checks whether a username is valid.
Related Functions: validate_user_form, validate_user_signup, validate_current_theme, validate_email, validate_plugin
	Source
function validate_username( $username ) {
	$sanitized = sanitize_user( $username, true );
	$valid     = ( $sanitized === $username && ! empty( $sanitized ) );
	/**
	 * Filters whether the provided username is valid.
	 *
	 * @since 2.0.1
	 *
	 * @param bool   $valid    Whether given username is valid.
	 * @param string $username Username to check.
	 */
	return apply_filters( 'validate_username', $valid, $username );
}