Opened 16 years ago
Closed 16 years ago
#12744 closed defect (bug) (fixed)
Querying with post_type and a taxonomy
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.0 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Query | Keywords: | has-patch tested commit |
| Focuses: | Cc: |
Description
Kind of weird. I've got a custom post type called property (real estate) and I'm able to use the post_type=property query to grab them. Now if I add some taxonomy to the query, such as post_type=property&location=italy then I'm left with all post types from italy, i.e. including posts.
The post_type parameter is being ignored and forced to any on line 2041 in query.php.
I also noticed that around line 1631 it's being forced again to any if we're doing a search, so a search with post_type=property will probably not work.
Thoughts?
Attachments (1)
Change History (5)
#2
@
16 years ago
- Keywords tested commit added
Seems to be working. This is what I used:
function debug_query() {
register_post_type('test', array('public' => true));
register_taxonomy('genre', 'test');
register_taxonomy_for_object_type('genre', 'post');
}
add_action('init', 'debug_query');
Going to ?genre=foobar&post_type=test gives the expected results.
Note: See
TracTickets for help on using
tickets.
Maybe this could work