Changeset 11324 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 05/14/2009 04:09:01 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r11263 r11324 2152 2152 * @since 2.5.0 2153 2153 * 2154 * @param int $term_id The term id for which to get a link.2154 * @param object|int|string $term 2155 2155 * @param string $taxonomy 2156 2156 * @return string HTML link to taxonomy term archive 2157 2157 */ 2158 function get_term_link( $term _id, $taxonomy ) {2158 function get_term_link( $term, $taxonomy ) { 2159 2159 global $wp_rewrite; 2160 $term_id = intval($term_id); 2160 2161 if ( !is_object($term) ) { 2162 if ( is_int($term) ) { 2163 $term = &get_term($term, $taxonomy); 2164 } else { 2165 $term = &get_term_by('slug', $term, $taxonomy); 2166 } 2167 } 2168 if ( is_wp_error( $term ) ) 2169 return $term; 2161 2170 2162 2171 // use legacy functions for core taxonomies until they are fully plugged in 2163 2172 if ( $taxonomy == 'category' ) 2164 return get_category_link((int) $term _id);2173 return get_category_link((int) $term->term_id); 2165 2174 if ( $taxonomy == 'post_tag' ) 2166 return get_tag_link((int) $term_id); 2167 2168 $term = &get_term($term_id, $taxonomy); 2169 2170 if ( is_wp_error( $term ) ) 2171 return $term; 2175 return get_tag_link((int) $term->term_id); 2172 2176 2173 2177 $termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
Note: See TracChangeset
for help on using the changeset viewer.