Title: Role   Include
Last modified: August 22, 2016

---

# Role Include

 *  [GregF](https://wordpress.org/support/users/gregf/)
 * (@gregf)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/role-include/)
 * Hello,
 * I need to include everyone in the “contributor” role, plus one user (me) in “
   admin”. I tried using [role=”contributor” include=”1″] but this resulted in an
   empty list. It appears that I can only use one or the other. Any way to accomplish
   this?
 * Thanks.
 * [https://wordpress.org/plugins/simple-user-listing/](https://wordpress.org/plugins/simple-user-listing/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/role-include/#post-5375053)
 * I think that is pretty counter to default queries so you probably can’t do it
   with default arguments. You might be able to do it by filtering `pre_user_query`
   and writing your own SQL where statements, but I wouldn’t have the slightest 
   idea how.
 *  Thread Starter [GregF](https://wordpress.org/support/users/gregf/)
 * (@gregf)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/role-include/#post-5375054)
 * Too bad. Guess I’ll just have to use include for everyone. Luckily, it’s not 
   a huge number. Thanks for the quick response.
 *  Plugin Author [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/role-include/#post-5375062)
 * As a sort of hackish way, you could filter the SUL query args, run a user query
   to get all the IDs of the contributors and then include all those IDs, PLUS your
   ID.
 * I tried the following and I was added to a list of subscribers, but I was added
   an infinite number of times. As I said, my SQL is pretty crap, but maybe it will
   give you some ideas.
 *     ```
       add_action( 'pre_user_query', 'kia_user_query' );
       function kia_user_query($query){
       	if( ! is_admin() && isset( $query->query_vars['query_id'] ) && $query->query_vars['query_id'] == 'simple_user_listing' ){
       		global $wpdb;
       		$my_user_id = 1;
       		$query->query_where .= " OR $wpdb->users.ID = $my_user_id";
       	}
       }
       ```
   
 *  Thread Starter [GregF](https://wordpress.org/support/users/gregf/)
 * (@gregf)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/role-include/#post-5375082)
 * One more question: Is there any way to control the list order arbitrarily? I 
   have one user (the Director) who needs to come first in the list.
 *  Plugin Author [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/role-include/#post-5375137)
 * Not that I know of. Either more complex SQL (SORTBY) or as a workaround you could
   give every user a specific meta key/value and then order by that.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Role Include’ is closed to new replies.

 * ![](https://ps.w.org/simple-user-listing/assets/icon-256x256.png?rev=3061308)
 * [Simple User Listing](https://wordpress.org/plugins/simple-user-listing/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-user-listing/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-user-listing/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-user-listing/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-user-listing/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-user-listing/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/role-include/#post-5375137)
 * Status: not resolved