User Role Editor
List users with certain role in template (3 posts)

  1. greencode
    Posted 2 years 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.


  2. Vladimir Garagulya
    Plugin Author

    Posted 2 years ago #

    Later is better than never :). Use the SQL query below to get needed users list:

    select b.user_login
    	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%';
  3. greencode
    Posted 2 years ago #

    Thanks for this but not sure how I would then list those users in my template?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Role Editor
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic