Changeset 10903 for trunk/wp-includes/category-template.php
- Timestamp:
- 04/09/2009 04:00:40 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/category-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r10888 r10903 294 294 */ 295 295 function category_description( $category = 0 ) { 296 global $cat; 297 if ( !$category ) 298 $category = $cat; 299 300 return get_term_field( 'description', $category, 'category' ); 296 return term_description( $category, 'category' ); 301 297 } 302 298 … … 800 796 801 797 /** 798 * Retrieve tag description. 799 * 800 * @since 2.8 801 * 802 * @param int $tag Optional. Tag ID. Will use global tag ID by default. 803 * @return string Tag description, available. 804 */ 805 function tag_description( $tag = 0 ) { 806 return term_description( $tag ); 807 } 808 809 /** 810 * Retrieve term description. 811 * 812 * @since 2.8 813 * 814 * @param int $term Optional. Term ID. Will use global term ID by default. 815 * @return string Term description, available. 816 */ 817 function term_description( $term = 0, $taxonomy = 'post_tag' ) { 818 if ( !$term && ( is_tax() || is_tag() || is_category() ) ) { 819 global $wp_query; 820 $term = $wp_query->get_queried_object(); 821 $taxonomy = $term->taxonomy; 822 $term = $term->term_id; 823 } 824 return get_term_field( 'description', $term, $taxonomy ); 825 } 826 827 /** 802 828 * Retrieve the terms of the taxonomy that are attached to the post. 803 829 *
Note: See TracChangeset
for help on using the changeset viewer.