Make WordPress Core

Ticket #1800: 1800.patch

File 1800.patch, 1.4 KB (added by skippy, 21 years ago)
  • template-functions-category.php

     
    274274}
    275275
    276276function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=FALSE) {
    277         global $wpdb, $category_posts;
     277        global $wpdb, $category_posts, $wp_query;;
    278278        // Optiondates now works
    279279        if ( '' == $file )
    280280                $file = get_settings('home') . '/';
    … …  
    383383                                $link .= ' ' . gmdate($optiondates, $category_timestamp["$category->cat_ID"]);
    384384                        }
    385385
    386                         if ( $list )
    387                                 $thelist .= "\t<li>$link\n";
    388                         else
     386                        if ( $list ) {
     387                                $thelist .= "\t<li";
     388                                if (($category->cat_ID == $wp_query->get_queried_object_id()) && is_category()) {
     389                                        $thelist .=  ' class="current-cat"';
     390                                }
     391                                $thelist .= ">$link\n";
     392                        } else {
    389393                                $thelist .= "\t$link<br />\n";
     394                        }
    390395
    391396                        if ($hierarchical && $children)
    392397                                $thelist .= list_cats($optionall, $all, $sort_column, $sort_order, $file, $list, $optiondates, $optioncount, $hide_empty, $use_desc_for_title, $hierarchical, $category->cat_ID, $categories, 1, $feed, $feed_image, $exclude, $hierarchical);