From 1d367b556cc583fcb0954ad3aa2c8b0d596de04d Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 11 May 2009 04:45:39 +0000 Subject: [PATCH] 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 --- wp-includes/taxonomy.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 3f1a47cc6..ccb03bc66 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -2158,14 +2158,6 @@ function _update_post_term_count( $terms ) { function get_term_link( $term, $taxonomy ) { 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_int($term) ) { $term = &get_term($term, $taxonomy); @@ -2176,6 +2168,14 @@ function get_term_link( $term, $taxonomy ) { if ( is_wp_error( $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; if ( empty($termlink) ) {