Allow for custom ordering in get_terms(). Fixes #7539 props DD32.
git-svn-id: http://svn.automattic.com/wordpress/trunk@11250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a977c155bf
commit
e61bea89ed
|
@ -533,9 +533,10 @@ function get_term_to_edit( $id, $taxonomy ) {
|
||||||
*
|
*
|
||||||
* The list of arguments that $args can contain, which will overwrite the defaults:
|
* The list of arguments that $args can contain, which will overwrite the defaults:
|
||||||
*
|
*
|
||||||
* orderby - Default is 'name'. Can be name, count, or nothing (will use
|
* orderby - Default is 'name'. Can be name, count, term_group, slug or nothing
|
||||||
* term_id).
|
* (will use term_id), Passing a custom value other than these will cause it to
|
||||||
*
|
* order based on the custom value.
|
||||||
|
*
|
||||||
* order - Default is ASC. Can use DESC.
|
* order - Default is ASC. Can use DESC.
|
||||||
*
|
*
|
||||||
* hide_empty - Default is true. Will not return empty terms, which means
|
* hide_empty - Default is true. Will not return empty terms, which means
|
||||||
|
@ -678,9 +679,10 @@ function &get_terms($taxonomies, $args = '') {
|
||||||
$orderby = 't.slug';
|
$orderby = 't.slug';
|
||||||
else if ( 'term_group' == $orderby )
|
else if ( 'term_group' == $orderby )
|
||||||
$orderby = 't.term_group';
|
$orderby = 't.term_group';
|
||||||
else
|
elseif ( empty($orderby) || 'id' == $orderby )
|
||||||
$orderby = 't.term_id';
|
$orderby = 't.term_id';
|
||||||
$orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
|
|
||||||
|
$orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
|
||||||
|
|
||||||
$where = '';
|
$where = '';
|
||||||
$inclusions = '';
|
$inclusions = '';
|
||||||
|
|
Loading…
Reference in New Issue