Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#16170 closed defect (bug) (fixed)

Tag queries don't set tag_id

Reported by: ryan Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Taxonomy Keywords:
Focuses: Cc:


Queries such as tag__* and tag_slug__* should set tag_id to the first term in the array of terms.

Attachments (3)

16170.diff (3.7 KB) - added by ryan 5 years ago.
16170.2.diff (4.0 KB) - added by scribu 5 years ago.
Default to uppercase operators
16170.3.diff (4.0 KB) - added by scribu 5 years ago.
NOT instead of NOT IN

Download all attachments as: .zip

Change History (10)

comment:1 @ryan5 years ago

I think this can be done fairly easily in the " Back-compat" block that loops over the tax queries. The wp_list_filter( ) call needs to be updated to allow for both IN and AND operators.

comment:2 follow-up: @scribu5 years ago

How would array( 'operator' => 'IN', 'operator' => 'AND' ) ever work?

@ryan5 years ago

comment:3 in reply to: ↑ 2 @ryan5 years ago

Replying to scribu:

How would array( 'operator' => 'IN', 'operator' => 'AND' ) ever work?

It wouldn't. :-) That was a for play version that I didn't mean to upload. Updated to add 'not in' support to wp_list_filter(). You must have saw it right before I replaced it.

Last edited 5 years ago by ryan (previous) (diff)

comment:4 @scribu5 years ago

16170.2.diff allows the operator arg to be in any case, for parity with tax_query.

Not sure if NOT IN is the best name, but hey.

@scribu5 years ago

Default to uppercase operators

@scribu5 years ago

NOT instead of NOT IN

comment:5 @scribu5 years ago

16170.3.diff uses NOT instead of NOT IN.

comment:6 @scribu5 years ago

Related: #16137

comment:7 @ryan5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17251]) Set tag_id for tag queries. Add NOT support to wp_list_filter(). Props scribu. fixes #16170

Note: See TracTickets for help on using tickets.