[wp-hackers] Can I use $query->set() (in a pre_get_posts() hook) with a custom taxonomy in WP 3?

Bill Erickson bill.erickson at gmail.com
Wed Jan 18 01:36:14 UTC 2012


I haven't tested it, but you should be able to do that with the tax_query.

Something like: https://gist.github.com/1630239


---
Bill Erickson
WordPress Consultant
http://www.billerickson.net


On Tue, Jan 17, 2012 at 7:26 PM, Rich Christiansen <warproof at warproof.com>wrote:

> Hello, all!
>
> I'm up against a wall here.  I'll demonstrate my problem with an example.
>  I can do something like the following with a standard category:
>
> $query->set('category__not_in'**, $term_id);
>
> But how do I do the same with a custom taxonomy term?
>
> I'm thinking I could use '<custom taxonomy name>__not_in' instead.
>
> This trac ticket seems to suggest that the functionality is available, but
> I can't make it work:
> http://core.trac.wordpress.**org/ticket/9951<http://core.trac.wordpress.org/ticket/9951>
>
> I'm using Wordpress 3.3.1 if it is relevant.  Thoughts?
>
> Thank you very much! :)
> -Rich
>
> ______________________________**_________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
> http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>
>


More information about the wp-hackers mailing list