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:
parent
0eaedf734f
commit
31db92d83e
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue