Make WordPress Core


Ignore:
Timestamp:
05/10/2009 07:57:07 AM (15 years ago)
Author:
westi
Message:

Allow for custom ordering in get_terms(). Fixes #7539 props DD32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r11245 r11250  
    534534 * The list of arguments that $args can contain, which will overwrite the defaults:
    535535 *
    536  * orderby - Default is 'name'. Can be name, count, or nothing (will use
    537  * term_id).
    538  *
     536 * orderby - Default is 'name'. Can be name, count, term_group, slug or nothing
     537 * (will use term_id), Passing a custom value other than these will cause it to
     538 * order based on the custom value.
     539 *
    539540 * order - Default is ASC. Can use DESC.
    540541 *
     
    679680    else if ( 'term_group' == $orderby )
    680681        $orderby = 't.term_group';
    681     else
     682    elseif ( empty($orderby) || 'id' == $orderby )
    682683        $orderby = 't.term_id';
    683         $orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
     684   
     685    $orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
    684686
    685687    $where = '';
Note: See TracChangeset for help on using the changeset viewer.