Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#16170 closed defect (bug) (fixed)

Tag queries don't set tag_id

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

Description

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 14 years ago.
16170.2.diff (4.0 KB) - added by scribu 14 years ago.
Default to uppercase operators
16170.3.diff (4.0 KB) - added by scribu 14 years ago.
NOT instead of NOT IN

Download all attachments as: .zip

Change History (10)

#1 @ryan
14 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.

#2 follow-up: @scribu
14 years ago

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

@ryan
14 years ago

#3 in reply to: ↑ 2 @ryan
14 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().

Version 0, edited 14 years ago by ryan (next)

#4 @scribu
14 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.

@scribu
14 years ago

Default to uppercase operators

@scribu
14 years ago

NOT instead of NOT IN

#5 @scribu
14 years ago

16170.3.diff uses NOT instead of NOT IN.

#6 @scribu
14 years ago

Related: #16137

#7 @ryan
14 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.