﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
17582,Problems with duplicated users,scribu,ryan,"Since WP 3.2, you can do this:

{{{
$users = get_users( array(
  'meta_query' => array(
    'relation' => 'OR',
    array(
      'key' => 'foo',
    ),
    array(
      'key' => 'bar',
    ),
  )
) );
}}}

which is great, except you can end up with a lot of duplicate users.

There's no straightforward way to tell WP_User_Query to add a distinct clause.

Sure, you can do this:

{{{
add_action( 'pre_user_query', function( $user_query ) {
  $user_query->query_fields = 'DISTINCT ' . $user_query->query_fields;
} );
}}}

but the query that populates {{{$user_query->total_users}}} will ignore that.",defect (bug),closed,normal,3.2,Query,,normal,fixed,close,
