[wp-trac] [WordPress Trac] #33827: WP Query: Custom Post Types and Categories
WordPress Trac
noreply at wordpress.org
Fri Sep 11 13:52:42 UTC 2015
#33827: WP Query: Custom Post Types and Categories
--------------------------+------------------------------
Reporter: atomicjack | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 4.3
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by swissspidy):
> I think we need to get this changed, so that, if it is a custom post
type, the cat= will look for the categories within that post type.
This would majorly break backwards compatibility.
The docs are very clear that `cat` is a category (built-in taxonomy
''category'') parameter. Just like that, `tag` is a tag (built-in
taxonomy ''post_tag'') parameter.
Custom post types usually use custom ''taxonomies''. Category is just one
taxonomy, terms is another. Developers are encouraged to use `tax_query`
for queries involving custom taxonomies rather than mis-using `cat` and
`tag` for something they aren't intended for. Even if that means more
typing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33827#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list