Pass IDs, not objects, to get_category_link(). fixes #9784

git-svn-id: http://svn.automattic.com/wordpress/trunk@11257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-05-11 04:45:39 +00:00
parent 602194e49a
commit 1d367b556c

View File

@ -2158,14 +2158,6 @@ function _update_post_term_count( $terms ) {
function get_term_link( $term, $taxonomy ) { function get_term_link( $term, $taxonomy ) {
global $wp_rewrite; global $wp_rewrite;
// use legacy functions for core taxonomies until they are fully plugged in
if ( $taxonomy == 'category' )
return get_category_link($term);
if ( $taxonomy == 'post_tag' )
return get_tag_link($term);
$termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
if ( !is_object($term) ) { if ( !is_object($term) ) {
if ( is_int($term) ) { if ( is_int($term) ) {
$term = &get_term($term, $taxonomy); $term = &get_term($term, $taxonomy);
@ -2176,6 +2168,14 @@ function get_term_link( $term, $taxonomy ) {
if ( is_wp_error( $term ) ) if ( is_wp_error( $term ) )
return $term; return $term;
// use legacy functions for core taxonomies until they are fully plugged in
if ( $taxonomy == 'category' )
return get_category_link((int) $term->term_id);
if ( $taxonomy == 'post_tag' )
return get_tag_link((int) $term->term_id);
$termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
$slug = $term->slug; $slug = $term->slug;
if ( empty($termlink) ) { if ( empty($termlink) ) {