WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. greencode
    Member
    Posted 1 year 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.

    http://wordpress.org/extend/plugins/user-role-editor/

  2. Vladimir Garagulya
    Member
    Plugin Author

    Posted 11 months 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
    Member
    Posted 11 months 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

About this Topic