#15752 closed defect (bug) (fixed)
Multiple taxonomy queries refinements
Reported by: | scribu | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | minor | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
Follow-up to #12891:
- ommiting 'field' or 'operator' from a tax query causes notices
- we use IN, even if we don't really support an array of taxonomies
Attachments (2)
Change History (29)
#2
@
14 years ago
Applied the patch and it works OK for my case. (Before the patch I was getting notices of undefined indexes if I did not define operator in a tax query.)
#5
@
14 years ago
r16844 just replaces this:
!$this->is_singular && !empty($this->tax_query)
with this:
$this->is_category || $this->is_tag || $this->is_tax
#7
@
14 years ago
WP_Tax_Query.diff just wraps get_tax_sql(), _set_tax_query_defaults() and _transform_terms() into a class.
The main advantage is that the queries are separated from the 'relation' arg, making them easier to work with.
#12
@
14 years ago
Still getting:
Notice: Trying to get property of non-object in /wp-includes/query.php on line 2657
Warning: Invalid argument supplied for foreach() in /wp-includes/functions.php on line 3064
#17
@
14 years ago
Should probably make an alias for $this->is_category || $this->is_tag || $this->is_tax
.
#19
@
14 years ago
Currently, a plugin hooking into 'pre_get_posts' doesn't have access to the tax query object, so it would have to call parse_tax_query() on it's own.
#22
@
14 years ago
- Cc tott added
r16853 seems to introduce trouble with custom permalink structures such as
/%category%/%post_id%/%postname%/
In this cases the queried object refers to the term an not the post.
Changing the if condition to something like this seems to work.
if ( ( $this->is_category || $this->is_tag || $this->is_tax ) && ( ! $this->is_singular() && is_null( $this->post ) ) ) {
#25
@
14 years ago
Did rewrite rules change, perhaps? Mine flushed when I changed to the new structure, so I can't tell.
Introduce _set_tax_query_defaults()