[wp-trac] [WordPress Trac] #9719: Please : a filter for $category name in get_the_category_list()

WordPress Trac wp-trac at lists.automattic.com
Mon May 4 09:09:10 GMT 2009


#9719: Please : a filter for $category name in get_the_category_list()
-----------------------------+----------------------------------------------
 Reporter:  michelwppi       |       Owner:  anonymous
     Type:  feature request  |      Status:  new      
 Priority:  high             |   Milestone:           
Component:  General          |     Version:  2.8      
 Severity:  normal           |    Keywords:           
-----------------------------+----------------------------------------------
 To offer for one post more flexibility in how to display the names of
 categories in the_category() or in get_the_category_list() -file category-
 template line 166 - , is it possible to add a filter as the filter
 existing in wp_list_categories() .  Useful to replace cat name by instance
 by image ''(iphone compatible theme)'' or to add translation in bilingual
 or multilingual theme ''(by instance with xili-language plugin)'' without
 re-creating specific function.

 As in classes.php (line 1328), I suggest this modif with a filter named
 post_list_cats for the start of two loops present in
 get_the_category_list() (line 187 et 209)


 {{{
 foreach ( $categories as $category ) {
 $cat_name = attr( $category->name);
 $cat_name = apply_filters( 'post_list_cats', $cat_name, $category );
 }}}


 and inside the two loops, $category->cat_name replaced by $cat_name


 with this filter it will be more coherent to treate cat list in one post
 or in sidebar for all posts

 Many thanks

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9719>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list