username_exists WordPress Filter Hook
The username_exists hook is used to check whether a specified username exists. It is called when a user attempts to register or create a new account. If the username exists, the registration process is halted and an error message is displayed.
apply_filters( 'username_exists', int|false $user_id , string $username ) #
Filters whether the given username exists.
Parameters
- $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.
Source
File: wp-includes/user.php
Changelog
Version | Description |
---|---|
4.9.0 | Introduced. |