I'm trying to make a table of users by role type. What is the best-practices method of getting the user id? My goal is to print each users first & last names, username and email.
What I have now:
$get_admins = array(
'blog_id' => $GLOBALS['blog_id'],
'role' => 'administrator',
);
$blogusers = get_users($get_admins);
foreach ($blogusers as $user) {
$userid = get_userdata($bloguser->user_id);
$user_info = get_userdata($userid);
echo '<tr>';
echo '<td>'. $user_info->user_firstname .'</td>';
echo '<td>'. $user_info->last_name .'</td>';
echo '<td>'. $user->user_login .'</td>';
echo '<td>'. $user->user_email .'</td>';
echo '</tr>';
}
note: In my example above getting the user id does not work.
Codex reference: get_users()