I have an array of user IDs, I want to get data for each of these users. I first thought of writing a classic SQL query but I found WordPress has integreted functions for it. However,
get_users(...) is only returning me 1 users though it should return 3. What am I doing wrong?
var_dump($targetUsersIDs); $targetUsers = get_users(['include' => $targetUsersIDs]); var_dump($targetUsers);
array (size=3) 0 => object(stdClass) public 'ID' => string '1' (length=1) 1 => object(stdClass) public 'ID' => string '2' (length=1) 2 => object(stdClass) public 'ID' => string '4' (length=1)
Start of the output of
array (size=1) 0 => object(WP_User) ...