Add `current-cat-ancestor` class to ancestor items in `wp_list_categories()`.

Pairs nicely with `current-cat-parent`.

Props jrchamp, swisssipdy, ardathksheyna, wonderboymusic.
Fixes #10676.
Built from https://develop.svn.wordpress.org/trunk@36008


git-svn-id: http://core.svn.wordpress.org/trunk@35973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2015-12-18 18:38:25 +00:00
parent 0eaedf734f
commit 31db92d83e
2 changed files with 8 additions and 1 deletions

View File

@ -170,6 +170,13 @@ class Walker_Category extends Walker {
} elseif ( $category->term_id == $_current_term->parent ) {
$css_classes[] = 'current-cat-parent';
}
while ( $_current_term->parent ) {
if ( $category->term_id == $_current_term->parent ) {
$css_classes[] = 'current-cat-ancestor';
break;
}
$_current_term = get_term( $_current_term->parent, $category->taxonomy );
}
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36007';
$wp_version = '4.5-alpha-36008';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.