[wp-hackers] WP User Query with two meta keys

Otto otto at ottodestruct.com
Tue May 1 17:14:51 UTC 2012


On Tue, May 1, 2012 at 11:27 AM, Robert Lusby <nanogwp at gmail.com> wrote:
> Is it possible to select a user matching "two" meta keys and values, in WP
> User Query?

Not with WP_User_Query, no.

> If not - how would you go about this?

Direct SQL queries is the only way I know of. There isn't any support
for it in the core objects at present.

You could extend the WP_User_Query class to add support for more fine
grained meta queries, but again, you'd be writing new SQL in that
class.

-Otto


More information about the wp-hackers mailing list