From f57c5009b529dcc2494fc719f605ef64b7f9b4c7 Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 1 Dec 2006 15:41:48 +0000 Subject: Category fixes from Andy git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@818 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/classes.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'wp-includes/classes.php') diff --git a/wp-includes/classes.php b/wp-includes/classes.php index f60b50d..f8bb896 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -616,13 +616,14 @@ class Walker_Category extends Walker { $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); } - $_current_category = get_category( $current_category ); + if ( $current_category ) + $_current_category = get_category( $current_category ); if ( 'list' == $args['style'] ) { $output .= "\tcat_ID == $current_category) && is_category() ) + if ( $current_category && ($category->cat_ID == $current_category) ) $output .= ' class="current-cat"'; - elseif ( ($category->cat_ID == $_current_category->category_parent) && is_category() ) + elseif ( $_current_category && ($category->cat_ID == $_current_category->category_parent) ) $output .= ' class="current-cat-parent"'; $output .= ">$link\n"; } else { -- cgit