Filter to wp_list_authors

I am using wp_list_authors, to, how function name says, make a list of authors, but i want to show only "Authors". Now in my site, any account who publish a text ("Admin", "Editor") show his name in my list of authors, but i want ONLY users who are Authors. How can i make this happen?

My code now

?php $args = array(
  'orderby'       = 'name',
  'order'         = 'ASC',
  'number'        = 6,
  'optioncount'   = true,
  'exclude_admin' = true,
  'show_fullname' = false,
  'hide_empty'    = true,
  'echo'          = true,
  'style'         = 'list',
  'html'          = true); ?

Topic list-authors functions filters users Wordpress

Category Web


wp_list_authors(), displays a list of the sites's authors (users), and if the user has authored any posts, the author name is displayed as a link to their posts.

Use

 $authors = get_users( [ 'role__in' => [ 'auther'] ],
                // add other parameters
                );

Then loop through $authors to create your own list.

foreach ( $authors as $author ) {
    // your list goes here
}

I hope this helps to start.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.