Opened 19 years ago
Closed 19 years ago
#4123 closed enhancement (fixed)
New function get_the_tag similar to get_the_category w/ patch
| Reported by: | tacker | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 2.2 |
| Component: | Template | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
-
wp-includes/category-template.php
203 203 echo get_the_tags( $before, $sep, $after ); 204 204 } 205 205 206 function get_the_tag($id = 0) { 207 global $post; 208 if ( !$post ) 209 return false; // in-the-loop function 210 211 $id = (int) $id; 212 if ( !$id ) 213 $id = (int) $post->ID; 214 215 $tags = get_post_tags( $post->ID ); 216 if ( empty( $tags ) ) 217 return false; 218 219 return $tags; 220 } 221 206 222 function category_description($category = 0) { 207 223 global $cat; 208 224 if ( !$category )
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
To be more consistent with the category API, your code in get_the_tag() should replace the code in get_the_tags(), and the code currently in get_the_tags() should be in the_tags().