[wp-trac] [WordPress Trac] #9951: Add [taxonomy]__in, [taxonomy]__not_in to wp_query
WordPress Trac
wp-trac at lists.automattic.com
Tue Jan 12 17:46:52 UTC 2010
#9951: Add [taxonomy]__in, [taxonomy]__not_in to wp_query
-------------------------+--------------------------------------------------
Reporter: joehoyle | Owner: ryan
Type: enhancement | Status: new
Priority: high | Milestone: 3.0
Component: Query | Version: 2.8
Severity: normal | Keywords: needs-patch early
-------------------------+--------------------------------------------------
Comment(by scribu):
> Do you mean add another arg to register_taxonomy() to specify a query
var to be used in query_posts()?
The query_var argument is already available:
[http://core.trac.wordpress.org/browser/tags/2.9.1/wp-
includes/taxonomy.php#L167]
Say you have a 'genre' custom taxonomy.
If it's hierarchical, these are the query vars that should become
available:
{{{
'genre', 'genre__in', 'genre__not_in', 'genre__and'
}}}
...in other words, the exact same query vars that are currently available
for categories.
If it's ''not'' hierarchical, these are the query vars that should become
available:
{{{
'genre', 'genre__in', 'genre__not_in', 'genre__and', 'genre_slug__in',
'genre_slug__and'
}}}
...in other words, the exact same query vars that are currently available
for tags.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9951#comment:17>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list