Make WordPress Core

Ticket #30635: 30635.patch

File 30635.patch, 1.1 KB (added by marsjaninzmarsa, 9 years ago)

fixes

  • wp-includes/category-template.php

     wp-includes/category-template.php | 23 +++++++++++++++--------
     1 file changed, 15 insertions(+), 8 deletions(-)
    
    diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
    index 7369fda..05a39e9 100644
    a b class Walker_Category extends Walker { 
    10291027                                if ( $category->term_id == $args['current_category'] ) {
    10301028                                        $class .=  ' current-cat';
    10311029                                } elseif ( $category->term_id == $_current_category->parent ) {
    1032                                         $class .=  ' current-cat-parent';
     1030                                        $class .=  ' current-cat-parent current-cat-ancestor';
     1031                                } else {
     1032                                        $_current_category_ancestor = get_term( $_current_category->parent, $category->taxonomy );
     1033                                        while( $_current_category_ancestor->parent ) {
     1034                                                if ( $category->term_id == $_current_category_ancestor->parent ) {
     1035                                                        $class .=  ' current-cat-ancestor';
     1036                                                        break;
     1037                                                }
     1038                                                $_current_category_ancestor = get_term( $_current_category_ancestor->parent, $category->taxonomy );
     1039                                        }
    10331040                                }
    10341041                        }
    10351042                        $output .=  ' class="' . $class . '"';