[wp-trac] [WordPress Trac] #38278: Only query taxonomies assigned to the post types being queried
WordPress Trac
noreply at wordpress.org
Mon Oct 10 20:28:54 UTC 2016
#38278: Only query taxonomies assigned to the post types being queried
-------------------------+-----------------------------
Reporter: desrosj | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
While working on #31383 (Add `WP_Tax_Query` support to `WP_User_Query`),
it was brought up that taxonomy queries do not check to see whether the
requested taxonomies are registered to the requested post type.
Opening this ticket to discuss further. Should taxonomies always match the
queried `post_type`?
From @boonebgorges on the other ticket:
Here's a way to frame the issue: are we likely to confuse developers if
we allow (ie, don't throw errors for) queries like `get_users( ...
'tax_query' => ... 'taxonomy=post_tag' )`? Or `get_posts( ... 'tax_query'
=> ... 'taxonomy=some_user_taxonomy' )`? Or maybe these queries will just
always end up empty? We should think through the possible confusions (or,
maybe, lack thereof).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38278>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list