From c3b6ef86ea39ab2a11bed4fb9d29bb346b7e9848 Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 9 Nov 2010 01:20:38 +0000 Subject: [PATCH] Confirm that the queried term object is of the requested taxonomy in wp_list_categories. fixes #15347. git-svn-id: http://svn.automattic.com/wordpress/trunk@16250 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 69e56a575..911f408cd 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -471,8 +471,11 @@ function wp_list_categories( $args = '' ) { else $output .= '' . $show_option_all . ''; - if ( empty( $r['current_category'] ) && ( is_category() || is_tax() ) ) - $r['current_category'] = get_queried_object_id(); + if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) { + $current_term_object = get_queried_object(); + if ( $r['taxonomy'] == $current_term_object->taxonomy ) + $r['current_category'] = get_queried_object_id(); + } if ( $hierarchical ) $depth = $r['depth'];