I'm bumping into this issue where if I login as a user, the function works and pulls up the info that I need but if I login as an admin it returns bool(false). Any clue as to why is this happening?
This is on a folder on the root of the project in which /wp-config.php and /wp-includes/wp-db.php have been included. Is this normal behavior?
Thanks
EDIT:
For those asking what 7 is, it's just an example user_id but obviously I'm bringing it from somewhere else where it works.
All in all get_user_by is a Wordpress API function that yields results when I'm logged in as a user but not when I'm logged in as an admin for whatever reason.