validate_username filter-hookWP 2.0.1

Filters whether the provided username is valid.

Usage

add_filter( 'validate_username', 'wp_kama_validate_username_filter', 10, 2 );

/**
 * Function for `validate_username` filter-hook.
 * 
 * @param bool   $valid    Whether given username is valid.
 * @param string $username Username to check.
 *
 * @return bool
 */
function wp_kama_validate_username_filter( $valid, $username ){

	// filter...
	return $valid;
}
$valid(true|false)
Whether given username is valid.
$username(string)
Username to check.

Changelog

Since 2.0.1 Introduced.

Where the hook is called

validate_username()
validate_username
wp-includes/user.php 2009
return apply_filters( 'validate_username', $valid, $username );

Where the hook is used in WordPress

Usage not found.