Title: WordPress 3.6 get_users function wonkiness
Last modified: August 21, 2016

---

# WordPress 3.6 get_users function wonkiness

 *  [Nikki Blight](https://wordpress.org/support/users/kionae/)
 * (@kionae)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wordpress-36-get_users-function-wonkiness/)
 * Interesting oddity when I upgraded to 3.6 this morning. A plugin I wrote uses
   the get_users() function to fetch users that are assigned to one of the roles
   in a given list. It had been working fine right up until the upgrade.
 * I finally tracked the problem down to the “fields” parameter of the get_users()
   function. For some reason, when I was using that parameter, an empty result set
   was returned. Take it out, and it works just fine.
 * Code snippet is below for reference. I’m not sure if this is a bug, or if something
   changed about the way one is supposed to use the get_users() function.
 *     ```
       $meta_query = array('relation' => 'OR');
       foreach($add_roles as $role) {
       	$meta_query[] = array(
       				'key' => $table_prefix.'capabilities',
       				'value' => $role,
       				'compare' => 'like'
       			);
       }
   
       //get all eligible users
       $args = array(
       		'meta_query' => $meta_query,
       		'orderby' => 'display_name',
       		'order' => 'ASC',
       		'fields' => array('ID, display_name'),
       );
   
       $users = get_users($args);
       ```
   

The topic ‘WordPress 3.6 get_users function wonkiness’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Nikki Blight](https://wordpress.org/support/users/kionae/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/wordpress-36-get_users-function-wonkiness/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
