I’m trying to get various pieces of data from an array of users added through the User Field, which is also assigned to all user profiles.
Below is the code I’m using to get the array and then to try and get the IDs.
$user = get_field('worked_with', $user_id_prefixed); // this gives us an array of all user data..
$userID = $user["ID"]; // grabs the user ID
var_dump($user);
echo $userID;
The array is returned successfully. I just appear to be trying to get the ID incorrectly.
This was resolved by including a foreach:
foreach ($users as $user) {}