-1

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.

Shailesh Chauhan
  • 559
  • 3
  • 14
logicbloke
  • 139
  • 3
  • 13

1 Answers1

0

I didn't have the following file included, that's why the function didn't work on other custom made pages.

wp-includes/pluggable.php
logicbloke
  • 139
  • 3
  • 13