Show other users in author drop down

Add the code below to the functions.php file. Make the changes, and then remove the code. This works for showing users with the ‘team member’ role. Adjust for other roles.

add_filter('wp_dropdown_users', 'MySwitchUser');
function MySwitchUser($output)
{

//global $post is available here, hence you can check for the post type here
$users = get_users('role=team_member');

$output = "<select id=\"post_author_override\" name=\"post_author_override\" class=\"\">";

//Leave the admin in the list
$output .= "<option value=\"1\">Admin</option>";
foreach($users as $user)
{
$sel = ($post->post_author == $user->ID)?"selected='selected'":'';
$output .= '<option value="'.$user->ID.'"'.$sel.'>'.$user->user_login.'</option>';
}
$output .= "</select>";

return $output;
}