[wp-trac] [WordPress Trac] #16854: wp_query does not handle multiple exclude author properly

WordPress Trac wp-trac at lists.automattic.com
Fri Jun 10 15:01:57 UTC 2011


#16854: wp_query does not handle multiple exclude author properly
------------------------------------+------------------------------
 Reporter:  commentluv              |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Query                   |     Version:  3.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------
Changes (by boonebgorges):

 * keywords:  needs-patch => has-patch dev-feedback


Comment:

 I ran into this problem myself so I wrote up a patch. It does not add
 author__in and author__not_in, but it does, in effect, do those things
 with the 'author' param. See 16854.patch

 Essentially, if you pass only '-' values to 'author', a NOT IN query is
 assembled. If you pass only values without an '-', you get an IN query. If
 you pass a mix of '-' and non-'-', the '-' values are ignored and you get
 an IN query (since the NOTs would be redundant anyway).

 While I was refactoring, I introduced support for passing an array as well
 as a string.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16854#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list