[wp-trac] [WordPress Trac] #5245: Get_terms more general sorting in taxonomy.php

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 23 12:36:33 GMT 2007


#5245: Get_terms more general sorting in taxonomy.php
----------------------------+-----------------------------------------------
 Reporter:  michelwp        |       Owner:  anonymous             
     Type:  enhancement     |      Status:  new                   
 Priority:  normal          |   Milestone:  2.4                   
Component:  Administration  |     Version:  2.3                   
 Severity:  normal          |    Keywords:  terms sorting taxonomy
----------------------------+-----------------------------------------------
 taxonomy is a powerful tool than can be used not only for ''category'',
 ''post_tag'' or l''ink_category''. I test it to develop multilingual set
 (theme + plugin) and create '''language''' and '''dictionary'''
 taxonomies... Some small bugs was detected (#5230, #5240). To reuse
 standard stable scripts, it will be good if sorting can be set not only
 for count, name or term_id but also for '''slug''' and why not for
 term_group.

 current code

 {{{
 if ( 'count' == $orderby )
                 $orderby = 'tt.count';
         else if ( 'name' == $orderby )
                 $orderby = 't.name';
         else
                 $orderby = 't.term_id';
 }}}

 expected code


 {{{
 if ( 'count' == $orderby )
                 $orderby = 'tt.count';
         else if ( 'name' == $orderby )
                 $orderby = 't.name';
         else if ( 'slug' == $orderby )
                 $orderby = 't.slug';
         else if ( 'term_group' == $orderby )
                 $orderby = 't.term_group';
         else
                 $orderby = 't.term_id';
 }}}

 Hope it will be useful for other developers.

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


More information about the wp-trac mailing list