commit ceceb93a0b8ab6adbc54879453d12abbbdd9cafe
Author: Jonathan Champ <jrchamp@ncsu.edu>
Date: Thu Aug 22 17:58:35 2013 -0400
JRCHAMP Core - Set current-cat-ancestor class on list items similar to the page hierarchy
diff --git a/wp-includes/class-walker-category.php b/wp-includes/class-walker-category.php
index da518c9..8ef3c58 100644
a
|
b
|
class Walker_Category extends Walker { |
170 | 170 | } elseif ( $category->term_id == $_current_term->parent ) { |
171 | 171 | $css_classes[] = 'current-cat-parent'; |
172 | 172 | } |
| 173 | while ( $_current_term->parent ) { |
| 174 | if ( $category->term_id == $_current_term->parent ) { |
| 175 | $css_classes[] = 'current-cat-ancestor'; |
| 176 | break; |
| 177 | } |
| 178 | $_current_term = get_term( $_current_term->parent, $category->taxonomy ); |
| 179 | } |
173 | 180 | } |
174 | 181 | } |
175 | 182 | |