I must be doing something wrong, but the following commented code returns false. Note that WP is returning 'admin' as the 'user_login', but when that user_login is used for the get_user_by()
function it simply returns false. Am I missing something?
$user = get_userdata(1); // (admin ID is 1)
var_dump($user->user_login); // string(5) 'admin'
var_dump(get_user_by('user_login', $user->user_login)); // bool(false)
I am running WordPress 4.8.2