Display Users from two roles in one list

Since the roles for a user are stored in (dbprefix)_capabilities, I’d try grabbing the database prefix and then using it to grab people with the right capabilities (caps are in a serialized array): global $wpdb; $prefix = $wpdb->prefix; $meta_name = “{$prefix}capabilities”; ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => “{$meta_name}” ‘value’ => ‘program_manager’, ‘compare’ … Read more

How can I include user meta information in the resulting array of a WP_User_Query?

To sort by meta fields you need to use meta_key and meta_value (or meta_value_num): array( ‘meta_key’ => ‘sort_order’, //This is the custom field to orderby ‘orderby’ => ‘meta_value_num’, //for numerical values ‘role’ => ‘Administrator’, ‘fields’ => ‘all_with_meta’, ); However… This will probably order the results before your merge… so, instead of separate queries you can … Read more