[wp-trac] [WordPress Trac] #6590: Add has_tag function to determine if a post has a given tag

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 4 18:16:25 GMT 2008


#6590: Add has_tag function to determine if a post has a given tag
-------------------------+--------------------------------------------------
 Reporter:  Otto42       |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.6      
Component:  Template     |     Version:           
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 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.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6590>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list