Make WordPress Core

Ticket #2466: apply list_cats filter consistently consolidated.diff

File apply list_cats filter consistently consolidated.diff, 2.4 KB (added by majelbstoat, 19 years ago)

Patch to replace the previous two. In addition, adds filter calls to get_the_category_list

  • C:/Xampp/htdocs/development/subversion/wordpress/wp-admin/admin-functions.php

     
    580580                        $result[$cat]['children'] = get_nested_categories($default, $cat);
    581581                        $result[$cat]['cat_ID'] = $cat;
    582582                        $result[$cat]['checked'] = in_array($cat, $checked_categories);
    583                         $result[$cat]['cat_name'] = get_the_category_by_ID($cat);
     583                        $result[$cat]['cat_name'] = apply_filters('list_cats', get_the_category_by_ID($cat), $cat);
    584584                }
    585585        }
    586586
  • C:/Xampp/htdocs/development/subversion/wordpress/wp-includes/template-functions-category.php

     
    4848        if ( '' == $separator ) {
    4949                $thelist .= '<ul class="post-categories">';
    5050                foreach ( $categories as $category ) {
     51                        $category->cat_name = apply_filters('list_cats', $category->cat_name, $category);
    5152                        $thelist .= "\n\t<li>";
    5253                        switch ( strtolower($parents) ) {
    5354                                case 'multiple':
     
    7071        } else {
    7172                $i = 0;
    7273                foreach ( $categories as $category ) {
     74                        $category->cat_name = apply_filters('list_cats', $category->cat_name, $category);
    7375                        if ( 0 < $i )
    7476                                $thelist .= $separator . ' ';
    7577                        switch ( strtolower($parents) ) {
  • C:/Xampp/htdocs/development/subversion/wordpress/wp-includes/template-functions-general.php

     
    232232function single_cat_title($prefix = '', $display = true ) {
    233233        $cat = intval( get_query_var('cat') );
    234234        if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) {
    235                 $my_cat_name = get_the_category_by_ID($cat);
     235                $my_cat_name = apply_filters('list_cats', get_the_category_by_ID($cat), $cat);
    236236                if ( !empty($my_cat_name) ) {
    237237                        if ( $display )
    238238                                echo $prefix.strip_tags($my_cat_name);