Make WordPress Core

Ticket #4506: general-template.php.diff

File general-template.php.diff, 914 bytes (added by gdevlugt, 18 years ago)
  • wp-includes/general-template.php

     
    265265
    266266function single_cat_title($prefix = '', $display = true ) {
    267267        $cat = intval( get_query_var('cat') );
     268        $tag = intval( get_query_var('tag_id') );
     269
    268270        if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) {
    269271                $my_cat_name = apply_filters('single_cat_title', get_the_category_by_ID($cat));
    270272                if ( !empty($my_cat_name) ) {
     
    274276                                return strip_tags($my_cat_name);
    275277                }
    276278        }
     279
     280        if ( !empty($tag) ) {
     281                $tag = get_term($tag, 'post_tag');
     282                $my_tag_name = apply_filters('single_tag_title', $tag->slug);
     283                if ( ! empty($my_tag_name) ) {
     284                        if ( $display )
     285                                echo $prefix.strip_tags($my_tag_name);
     286                        else
     287                                return strip_tags($my_tag_name);
     288                }
     289        }
    277290}
    278291
    279292