username_exists filter-hookWP 4.9.0

Filters whether the given username exists.

Usage

add_filter( 'username_exists', 'wp_kama_username_exists_filter', 10, 2 );

/**
 * Function for `username_exists` filter-hook.
 * 
 * @param int|false $user_id  The user ID associated with the username, or false if the username does not exist.
 * @param string    $username The username to check for existence.
 *
 * @return int|false
 */
function wp_kama_username_exists_filter( $user_id, $username ){

	// filter...
	return $user_id;
}
$user_id(int|false)
The user ID associated with the username, or false if the username does not exist.
$username(string)
The username to check for existence.

Changelog

Since 4.9.0 Introduced.

Where the hook is called

username_exists()
username_exists
wp-includes/user.php 1954
return apply_filters( 'username_exists', $user_id, $username );

Where the hook is used in WordPress

Usage not found.