[wp-hackers] Can't exclude two authors in WP

Ryan McCue lists at rotorised.com
Sun Jan 15 05:15:48 UTC 2012


Robert Lusby wrote:
> Neither works:
> 
> $args = array('author=-2,-3,-4');
> $newquery = WP_Query($args);
> 
> $args = array('author' => '-2,-3,-4');
> $newquery = WP_Query($args);

That's because the patch never got committed.

Your best bet is filtering the SQL at some point and adding it yourself.
If you really want to avoid that, you could make multiple WP_Querys and
only include a post if it's in all of the objects. That could get
complicated though, so I'd go for the SQL.

-- 
Ryan McCue
<http://ryanmccue.info/>


More information about the wp-hackers mailing list