Trying to get the user's login, by searching for the current user with a custom field value (meta_value). The problem is that i get the same result, even when i try to provide false meta_value, to test the "not found" part of my code. So far i have this.
$user = reset(
get_users(
array(
'meta_key' => 'egt_session_key',
'meta_value' => 'some_custom_field_data',
'number' => 1,
'count_total' => false
)
)
);
$user = get_users($user);
echo $user[0]->data->user_login;