Changeset 11263
- Timestamp:
- 05/11/2009 04:37:42 PM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r11204 r11263 888 888 889 889 foreach ( $terms as $term ) { 890 $link = get_term_link( $term , $taxonomy );890 $link = get_term_link( $term->term_id, $taxonomy ); 891 891 if ( is_wp_error( $link ) ) 892 892 return $link; -
trunk/wp-includes/taxonomy.php
r11260 r11263 2152 2152 * @since 2.5.0 2153 2153 * 2154 * @param object|int|string $term2154 * @param int $term_id The term id for which to get a link. 2155 2155 * @param string $taxonomy 2156 2156 * @return string HTML link to taxonomy term archive 2157 2157 */ 2158 function get_term_link( $term , $taxonomy ) {2158 function get_term_link( $term_id, $taxonomy ) { 2159 2159 global $wp_rewrite; 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 } 2160 $term_id = intval($term_id); 2161 2162 // use legacy functions for core taxonomies until they are fully plugged in 2163 if ( $taxonomy == 'category' ) 2164 return get_category_link((int) $term_id); 2165 if ( $taxonomy == 'post_tag' ) 2166 return get_tag_link((int) $term_id); 2167 2168 $term = &get_term($term_id, $taxonomy); 2169 2168 2170 if ( is_wp_error( $term ) ) 2169 2171 return $term; 2170 2171 // use legacy functions for core taxonomies until they are fully plugged in2172 if ( $taxonomy == 'category' )2173 return get_category_link((int) $term->term_id);2174 if ( $taxonomy == 'post_tag' )2175 return get_tag_link((int) $term->term_id);2176 2172 2177 2173 $termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
Note: See TracChangeset
for help on using the changeset viewer.