WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 3 years ago

#12419 closed enhancement (wontfix)

Add intersect & union support in get_(term|tag|category)_link()

Reported by: scribu Owned by: scribu
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: needs-patch
Focuses: Cc:

Description

Taxonomy Intersections and Unions support has been around since WP 2.3, but the get_term_link() functions only work with a single term.

Examples:

get_tag_link(array('foo', 'bar'), 'or')  

--> http://example.com/tag/foo,bar
get_tag_link(array('foo', 'bar'), 'and')  

--> http://example.com/tag/foo+bar

Change History (6)

comment:1 @scribu6 years ago

The first example should probably be:

get_tag_link(array('foo', 'bar'), 'in')

comment:2 @dd325 years ago

  • Keywords needs-patch added

comment:3 @filosofo5 years ago

  • Owner changed from filosofo to scribu
  • Status changed from new to assigned

This probably deserves its own function. Function overloading makes things confusing and harder to support in my opinion.

Also, the arbitrary combination of taxonomy items seems more like a search query than a link to a particular object's "canonical" URI, which is what the other get_* functions do. In my opinion.

comment:4 @kevinB5 years ago

  • Cc kevinB added

comment:5 @nacin5 years ago

  • Milestone changed from Awaiting Triage to Future Release

comment:6 @scribu3 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed

I agree with filosofo that this would be better as a separate function.

But, since there is no permalink support for such queries, one can just use add_query_arg() to construct a URL.

Note: See TracTickets for help on using tickets.