Support » Plugins and Hacks » User Role Editor » List users with certain role in template
3 years, 8 months ago
I’ve added a few new roles with User Role Editor but was wondering if there’s any way of listing users in the template code that have certain roles? For example I have “advisors” set up as one role and so would like a list of those users on my site.
3 years, 7 months ago
Later is better than never :). Use the SQL query below to get needed users list:
from wp_usermeta a
join wp_users b on a.user_id=b.ID
where a.meta_key='wp_capabilities' and a.meta_value like '%advisors%';
Thanks for this but not sure how I would then list those users in my template?