[wp-trac] [WordPress Trac] #32372: WP_User_Query fails on search_columns AND relation
WordPress Trac
noreply at wordpress.org
Fri May 15 12:40:33 UTC 2015
#32372: WP_User_Query fails on search_columns AND relation
-----------------------------+-------------------------
Reporter: tareq1988 | Owner:
Type: feature request | Status: closed
Priority: normal | Milestone:
Component: Users | Version: trunk
Severity: normal | Resolution: maybelater
Keywords: | Focuses:
-----------------------------+-------------------------
Changes (by boonebgorges):
* status: new => closed
* type: defect (bug) => feature request
* resolution: => maybelater
* milestone: Awaiting Review =>
Comment:
Thanks for the ticket.
The behavior you're describing here is not really a bug, it's just a
shortcoming of the implementation. The query is "failing" because you're
asking it to do something it's not designed to do.
> We should be able to define OR/AND by ourselves and if not defined, it
should fallback to AND.
I agree with this in a broad sense, but it's not at all clear how it'd
work. Recent improvements in tax/meta/date queries - and, in particular,
their support for nested query clauses - might point in the direction of a
syntax https://make.wordpress.org/core/2014/10/20/update-on-query-
improvements-in-4-1/. Doing something like this in a top-level query class
like `WP_User_Query` would be more complicated in a number of ways. For
example, some of the query args - like 'orderby' - operate only on the
aggregated results, and so can't be nested. More fundamentally, the
monolithic methods currently used to build SQL clauses would have to be
broken up into much smaller, reusable pieces.
I'd like for this to happen one day, but it's going to pretty much require
a complete rewrite of all of our query classes :) Thoughts and comments
welcome, but for now I'm closing this as maybelater.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32372#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list