summaryrefslogtreecommitdiffstats
path: root/wp-includes/category-template.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/category-template.php')
-rw-r--r--wp-includes/category-template.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index ba24302..1217276 100644
--- a/wp-includes/category-template.php
+++ b/wp-includes/category-template.php
@@ -185,9 +185,12 @@ function in_category( $category ) { // Check if the current post is in the given
if ( empty($category) )
return false;
- $cat_ID = get_cat_ID($category);
- if ( $cat_ID )
- $category = $cat_ID;
+ // If category is not an int, check to see if it's a name
+ if ( ! is_int($category) ) {
+ $cat_ID = get_cat_ID($category);
+ if ( $cat_ID )
+ $category = $cat_ID;
+ }
$categories = get_object_term_cache($post->ID, 'category');
if ( false === $categories )
@@ -272,7 +275,7 @@ function wp_list_categories($args = '') {
'style' => 'list', 'show_count' => 0,
'hide_empty' => 1, 'use_desc_for_title' => 1,
'child_of' => 0, 'feed' => '', 'feed_type' => '',
- 'feed_image' => '', 'exclude' => '',
+ 'feed_image' => '', 'exclude' => '', 'current_category' => 0,
'hierarchical' => true, 'title_li' => __('Categories'),
'echo' => 1, 'depth' => 0
);
@@ -309,7 +312,7 @@ function wp_list_categories($args = '') {
else
$output .= '<a href="' . get_bloginfo('url') . '">' . $show_option_all . '</a>';
- if ( is_category() )
+ if ( empty( $r['current_category'] ) && is_category() )
$r['current_category'] = $wp_query->get_queried_object_id();
if ( $hierarchical )