#27275 closed defect (bug) (invalid)
custom post, custom tax and category or post_tag
| Reported by: | aliwebdesarrollo | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | 3.8.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
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
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
@
13 years ago
- Component General → Query
- Focuses ui template performance removed
- Keywords needs-patch needs-unit-tests added
- Milestone Awaiting Review → 3.9
#2
in reply to: ↑ 1
@
13 years ago
Replying to wonderboymusic:
The appearance of
anyin thepost_typearray 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
@
13 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The appearance of
anyin thepost_typearray is scary.