get_user_by
get_user_by ( $field, $value )
Parameters:- (string) field The field to retrieve the user with. id | ID | slug | email | login.
- (int|string) value A value for $field. A user ID, slug, email address, or login name.
Returns:- (WP_User|false) WP_User object on success, false on failure.
Defined at:Change Log: - Introduced in WordPress: 2.8.0
- Deprecated in WordPress: —
Description
Retrieves user info by a given field.