Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#4895 closed defect (bug) (fixed)

Tag unions and intersections

Reported by: ryan's profile ryan Owned by:
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.3
Component: General Keywords: taxonomy, tags
Focuses: Cc:

Description (last modified by ryan)

As was done for categories in #4750, let's add private tag__in, tag__and, and tag__not_in query vars.

Let's also decide on how to specify intersections and unions in the public query vars. We have tag_id and tag. tag_id currently takes a single numeric ID, and tag takes a single tag slug. tag is the var we use when creating links and such. tag_id isn't exposed anywhere at the moment. I think we can extend tag to allow the use of "+" to request tag intersections and commas to request unions. Only one or the other can be specified in the same request.



Attachments (1)

tag_intersect_union.diff (5.3 KB) - added by ryan 17 years ago.

Download all attachments as: .zip

Change History (11)

#1 @ryan
17 years ago

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

(In [6011]) tagin, tagnot_in, and tag_and queries. fixes #4895

#2 @ryan
17 years ago

(In [6012]) tag_id not tagid. see #4895

#3 @ryan
17 years ago

  • Summary changed from Category unions and intersections to Tag unions and intersections

#4 @ryan
17 years ago

  • Description modified (diff)
  • Resolution fixed deleted
  • Status changed from closed to reopened

#5 @ryan
17 years ago

  • Description modified (diff)

#6 @ryan
17 years ago

  • Description modified (diff)

#7 @ryan
17 years ago

Patch parses "tag" queries that can plus and comma. Intersections are parsed into tag_slug__and and unions are parsed into tag_slug__in. The joins are rather hairy. Don't know if it would be best to get the IDs for the slugs in a separate query to spare the extra join.

#8 @markjaquith
17 years ago

Regarding tag_id, I don't think we should ever expose that because I don't think we should ever rely on that ID being static.

#9 @ryan
17 years ago

It's kinda there mainly for plugins that already have an ID. We could keep it and make it private.

#10 @ryan
17 years ago

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

(In [6021]) Tag unions and intersections. fixes #4895

Note: See TracTickets for help on using tickets.