Make WordPress Core

Ticket #10676: 10676.diff

File 10676.diff, 799 bytes (added by wonderboymusic, 11 years ago)
  • wp-includes/category-template.php

    diff --git wp-includes/category-template.php wp-includes/category-template.php
    index 96a61cf..3c5e66f 100644
    class Walker_Category extends Walker { 
    871871                        $class = 'cat-item cat-item-' . $category->term_id;
    872872                        if ( !empty($current_category) ) {
    873873                                $_current_category = get_term( $current_category, $category->taxonomy );
     874                                $category_ancestors = array_reverse( get_ancestors( $current_category, $category->taxonomy ) );
     875
     876                                if ( in_array( $category->term_id, $category_ancestors ) && $hierarchical )
     877                                        $class .= ' current-cat-ancestor';
     878                               
    874879                                if ( $category->term_id == $current_category )
    875880                                        $class .=  ' current-cat';
    876881                                elseif ( $category->term_id == $_current_category->parent )