Changeset 42368 for trunk/src/wp-includes/category-template.php
- Timestamp:
- 12/04/2017 09:48:24 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r42367 r42368 1201 1201 * 1202 1202 * @since 2.8.0 1203 * @since 4.9.2 The `$taxonomy` parameter was deprecated. 1203 1204 * 1204 1205 * @param int $term Optional. Term ID. Will use global term ID by default. 1205 * @param string $taxonomy Optional taxonomy name. Defaults to 'post_tag'.1206 1206 * @return string Term description, available. 1207 1207 */ 1208 function term_description( $term = 0 , $taxonomy = 'post_tag') {1208 function term_description( $term = 0 ) { 1209 1209 if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) { 1210 1210 $term = get_queried_object(); 1211 1211 if ( $term ) { 1212 $taxonomy = $term->taxonomy; 1213 $term = $term->term_id; 1214 } 1215 } 1216 $description = get_term_field( 'description', $term, $taxonomy ); 1212 $term = $term->term_id; 1213 } 1214 } 1215 $description = get_term_field( 'description', $term ); 1217 1216 return is_wp_error( $description ) ? '' : $description; 1218 1217 }
Note: See TracChangeset
for help on using the changeset viewer.