#22043 closed defect (bug) (fixed)
Undocumented default of post_type parameter to WP_Query with taxonomy queries
| Reported by: | dbernar1 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | WordPress.org |
| Component: | WordPress.org Site | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
14 years ago
- Summary WP_Query::is_tax true even when I am not really on a taxonomy page, but rather querying a taxonomy → Undocumented default of post_type parameter to WP_Query with taxonomy queries
#3
in reply to: ↑ 2
@
14 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 Awaiting Review → 3.7
- Resolution → fixed
- Status new → closed
I just updated the codex: http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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?