#27275 closed defect (bug) (invalid)
custom post, custom tax and category or post_tag
Reported by: | aliwebdesarrollo | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.8.1 |
Component: | Query | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
I was developing a new theme when i try to create a wp_query for a custom loop.
I create a custom post type
http://generatewp.com/snippet/lNKnjp4/
Custom taxonomy
http://generatewp.com/snippet/7QkXvPk/
WP_query
http://pastebin.com/rRSzyMKw
I was trying to get custom post, with a particular custom_taxonomy and a particular category
When i make a var_dump i found that the parameters of the wp_query where modify by the core, changing from 'my_custom_post' to 'post'.
I try it removing the category filter from the args (i keep the custom post type and custom tax) and the query i get was the right one without the filter i need.
this is the dump i have when i have the category__in
filter into args
http://pastebin.com/kTkJWL8n
as you could see the post_type was change from 'publicidad' to 'post'
this is the dump without the category__in
filter
Change History (7)
#1
follow-up:
↓ 2
@
11 years ago
- Component changed from General to Query
- Focuses ui template performance removed
- Keywords needs-patch needs-unit-tests added
- Milestone changed from Awaiting Review to 3.9
#2
in reply to:
↑ 1
@
11 years ago
Replying to wonderboymusic:
The appearance of
any
in thepost_type
array is scary.
Yes i know but i put it to test, i also try only with my custom post type, i was trying to find if i put any the query change in any aspect.
#4
@
11 years ago
I found that inside a setting file (not a plugin because this theme doesnt have it) it was set this:
$query->set( 'post_type', 'post' );
I spent 4 days trying to find out where it was the problem, and as i was creating a new query outside the main loop i belive that this set not affect the new query.
The appearance of
any
in thepost_type
array is scary.