From 07522b17d1957db81a324c0e2eac7d7b2e71da34 Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@16250 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 69e56a5753..911f408cdc 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'];