diff options
Diffstat (limited to 'wp-includes/classes.php')
| -rw-r--r-- | wp-includes/classes.php | 7 |
1 files changed, 4 insertions, 3 deletions
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 .= "\t<li"; - if ( ($category->cat_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 { |
