I am trying to change this code in my Authors List page template
$all_users = get_users(); $allowed_users = array(); foreach ( $all_users as $user ): $wp_user = new WP_User($user->ID); if ( !in_array( 'subscriber', $wp_user->roles ) ): array_push($allowed_users, $user); endif; endforeach;
to show only authors instead of "everyone except subscribers". I tried this:
if ( in_array( 'author', $wp_user->roles ) ):
and it does not work.
How can I change this code to show only users defined as 'author'?