Which function can be used to get the user’s object using the username? I’ve tried get_userdatabylogin() but the function seemed to throw an error:
Parse error, unexpected T_STRING on line xx
The function was called like so:
get_userdatabylogin($username);
That function should do what you want. Are you sure the error is not elsewhere?
You can also try using the
get_user_by()
(source) function:$user = get_user_by('login', 'MaryJane');
This is the same as
get_userdatabylogin('MaryJane');