Opened 18 years ago
Closed 18 years ago
#6590 closed enhancement (fixed)
Add has_tag function to determine if a post has a given tag
| Reported by: | Otto42 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6 |
| Component: | Template | Version: | |
| Severity: | normal | Keywords: | has-patch 2nd-opinion has_tag tag |
| Cc: | Focuses: |
Description
As discussed on wp-hackers, this is a patch for a "has_tag" function. New Loop function which takes a tag slug, id, or name (or array of such) and returns true if the post has that tag, false if it doesn't. Also takes a null input and returns true if the post has any tag.
Useful for theme developers to produce different things depending on tags. Compare to "in_category", as this is basically the same thing but for tags.
Patch for trunk attached.
Attachments (2)
Change History (4)
#1
@
18 years ago
- Keywords has-patch 2nd-opinion has_tag tag added
For reference: http://comox.textdrive.com/pipermail/wp-hackers/2008-April/019284.html
For the patch: +1
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Add has_tag function.