(string) (Required) The field to retrieve the user with. id | ID | slug | email | login.
value:
(int|string) (Required) A value for field. A user ID, slug, email address, or login name.
Return Value
:
It returns: WP_User object on success, false on failure
Example 1
:
Code
:
XHTML
1
2
3
4
[query.get_user_by
field='email'
value='abhishek@example.com'
/]
Output
:
Description
:
The above example code will output the user object in array as shown above. It has some useful key eg. the data key also hold array in its value which has key value like ID, name, email, etc.