How to get all users with Author role capabilities?

Today, We want to share with you get all users in wordpress.In this post we will show you wordpress show all users on one page, hear for Role and Capabilities of word press users. we will give you demo and example for implement.In this post, we will learn about How to get current user Information in word press? with an example.

Get Users List by Role in WordPress

WordPress has six pre-defined roles

  1. Super Admin
  2. administrator
  3. editor
  4. author
  5. subscriber
  6. contributor

You can get all users of wordpress using following simple PHP Source code. These simple source code print all wordpress user’s list.

Display all subscribers list of wordpress

 'subscriber',
 'orderby' => 'user_nicename',
 'order' => 'ASC'
);

$subscribers = get_users($params_val);

echo '
    '; foreach ($subscribers as $member) { echo '
  • ' . $member->display_name.'['.$member->user_email . ']
  • '; } echo '
'; ?>

Display all authors list of wordpress

 'admin',
 'orderby' => 'user_nicename',
 'order' => 'ASC'
);
 $all_members = get_users($params_val);
echo '
    '; foreach ($all_members as $member) { echo '
  • ' . $member->display_name.'['.$member->user_email . ']
  • '; } echo '
'; ?>

I hope you get an idea about get users by role wordpress.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment