Opened 3 years ago
Closed 11 months ago
#12419 closed enhancement (wontfix)
Add intersect & union support in get_(term|tag|category)_link()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | kevinB |
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)
- 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.
- 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.

The first example should probably be:
get_tag_link(array('foo', 'bar'), 'in')