[wp-trac] [WordPress Trac] #4123: New function get_the_tag similar to get_the_category w/ patch

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 10 09:26:26 GMT 2007


#4123: New function get_the_tag similar to get_the_category w/ patch
----------------------+-----------------------------------------------------
 Reporter:  tacker    |       Owner:  anonymous
     Type:  task      |      Status:  new      
 Priority:  low       |   Milestone:           
Component:  Template  |     Version:           
 Severity:  normal    |    Keywords:           
----------------------+-----------------------------------------------------
 {{{
 #!patch
 Index: wp-includes/category-template.php
 ===================================================================
 --- wp-includes/category-template.php   (Revision 5221)
 +++ wp-includes/category-template.php   (Arbeitskopie)
 @@ -203,6 +203,22 @@
         echo get_the_tags( $before, $sep, $after );
  }

 +function get_the_tag($id = 0) {
 +    global $post;
 +    if ( !$post )
 +        return false; // in-the-loop function
 +
 +    $id = (int) $id;
 +    if ( !$id )
 +        $id = (int) $post->ID;
 +
 +    $tags = get_post_tags( $post->ID );
 +    if ( empty( $tags ) )
 +        return false;
 +
 +    return $tags;
 +}
 +
  function category_description($category = 0) {
         global $cat;
         if ( !$category )
 }}}

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


More information about the wp-trac mailing list