#22043 closed defect (bug) (fixed)
Undocumented default of post_type parameter to WP_Query with taxonomy queries
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | WordPress.org | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | WordPress.org Site | Keywords: | |
| Focuses: | Cc: |
Description
post_type parameter default depends on the is_tax attribute. This is not documented here: http://codex.wordpress.org/Class_Reference/WP_Query#Type_.26_Status_Parameters
If is_tax is true, and post_type is not provided, the default of 'any' kicks in, and if is_tax is not set, the default of 'post' kicks in.
Either it is a bug, or perhaps just the documentation needs to be updated.
Please let me know what you think.
Thank you for sharing your software.
Change History (5)
#1
@
13 years ago
- Summary changed from WP_Query::is_tax true even when I am not really on a taxonomy page, but rather querying a taxonomy to Undocumented default of post_type parameter to WP_Query with taxonomy queries
#3
in reply to:
↑ 2
@
13 years ago
- Keywords reporter-feedback removed
Replying to wonderboymusic:
Your link points at the Status Parameters docs - did you mean status or post_type? And can you include some code that matches your use case / bug scenario?
It seems that the fragment structure on that page changed.
http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters is the link.
As for code, basically any WP_Query ( or query_posts and perhaps others) with a custom taxonomy specified, and without a post type specified. post_type WP_Query var will be 'any'.
#4
@
13 years ago
- Milestone changed from Awaiting Review to 3.7
- Resolution set to fixed
- Status changed from new to closed
I just updated the codex: http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters
Your link points at the Status Parameters docs - did you mean status or post_type? And can you include some code that matches your use case / bug scenario?