Opened 17 years ago
Closed 10 years ago
#7463 closed enhancement (maybelater)
Display multiple tag titles on tag unions and intersections
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.8 |
Component: | Taxonomy | Keywords: | needs-patch |
Focuses: | template | Cc: |
Description
Currently, tag unions and intersections only display the title of the first tag in the query, rather than all of them. This patch adds a new template function, multiple_tag_titles, which displays one or more tag titles for tag intersections and unions, adding a final 'and' or 'or' conjunction where appropriate.
Having written this patch, I'm starting to think it's the wrong approach: multiple taxonomy titles for taxonomy unions and intersections would be preferable.
Attachments (4)
Change History (21)
#3
@
16 years ago
- Version changed from 2.7 to 2.8
Just tested the patch against latest trunk, seems to still apply ok.
#4
@
16 years ago
- Keywords tested added; needs-feedback removed
_implode_nicely() would work with languages that read from right to left, or?
oh, and @since 2.7 should be @since 2.8 :-)
#5
@
16 years ago
Fixed the @since, cheers.
_implode_nicely() should work fine with RTL languages as long as they have list syntax that's similar enough to English (although guidance from someone with more experience in that area would be appreciated). One thing that strikes me now is that it probably shouldn't add spaces automatically, as it prevents one from just using a final comma rather than a connective word.
#7
@
16 years ago
The commas are run through () in the latest patch. I'm also wondering whether multiple_tag_titles() should be renamed to just tag_titles().
#8
@
16 years ago
might be. also of potential issue is the filter's name. it might be that some plugins relied on its old (single) version, if any.
#9
@
16 years ago
In that case, would it be worth passing the results through both filters and deprecating single_tag_title()?
#10
@
16 years ago
- Keywords dev-feedback added
this is just a guess: for backwards compatibility sake, core devs might think it's preferable to change the behavior of the new function (and pass all of the tags through the single_tag_title filter (or whatever it's called). and if they think like that I'd actually agree with them.
#11
follow-up:
↓ 12
@
16 years ago
This adds extra queries per tag, which is why we didn't add this from the beginning. Reducing to one query would be nice. In query.php where we do the single tag query we could call get_terms() with either 'include' or 'slugin' (which doesn't exist yet).
Can we add this to single_tag_title()so themes don't have to update templates?
The i18n on this is ugly, but I don't know if there's a good way to avoid concatenating strings.
$glue = __(', '), $conjuction = __(' and ')
You can't use function return as a default. We usually default to false or null and then assign the default string if false inside the function.
#12
in reply to:
↑ 11
@
16 years ago
- Keywords needs-patch added; has-patch tested dev-feedback removed
Replying to ryan:
This adds extra queries per tag, which is why we didn't add this from the beginning. Reducing to one query would be nice.
you mean on the get_terms() and get_term_by() calls, right? if so, there's room to bulk grab tags in order to cache the result, ya.
#13
@
16 years ago
- Milestone changed from 2.8 to Future Release
moving to future from lack of refreshed patch
Moving enhancements to 2.8.