mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Add 'orderby=description' support to get_terms().
This fixes an interface inconsistency in edit-tags.php, where Description appears as a sortable column header. Props neil_pie. Fixes #31364. git-svn-id: https://develop.svn.wordpress.org/trunk@31532 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1574,11 +1574,11 @@ function get_term_to_edit( $id, $taxonomy ) {
|
||||
* @param array|string $args {
|
||||
* Optional. Array or string of arguments to get terms.
|
||||
*
|
||||
* @type string $orderby Field(s) to order terms by. Accepts term fields ('name', 'slug',
|
||||
* 'term_group', 'term_id', 'id'), 'count' for term taxonomy count,
|
||||
* 'include' to match the 'order' of the $include param, or 'none'
|
||||
* to skip ORDER BY. Defaults to 'name'.
|
||||
* @type string $order Whether to order terms in ascending or descending order.
|
||||
* @type string $orderby Field(s) to order terms by. Accepts term fields ('name', 'slug',
|
||||
* 'term_group', 'term_id', 'id', 'description'), 'count' for term
|
||||
* taxonomy count, 'include' to match the 'order' of the $include param,
|
||||
* or 'none' to skip ORDER BY. Defaults to 'name'.
|
||||
* @type string $order Whether to order terms in ascending or descending order.
|
||||
* Accepts 'ASC' (ascending) or 'DESC' (descending).
|
||||
* Default 'ASC'.
|
||||
* @type bool|int $hide_empty Whether to hide terms not assigned to any posts. Accepts
|
||||
@@ -1747,6 +1747,8 @@ function get_terms( $taxonomies, $args = '' ) {
|
||||
$orderby = "FIELD( t.term_id, $include )";
|
||||
} elseif ( 'term_group' == $_orderby ) {
|
||||
$orderby = 't.term_group';
|
||||
} elseif ( 'description' == $_orderby ) {
|
||||
$orderby = 'tt.description';
|
||||
} elseif ( 'none' == $_orderby ) {
|
||||
$orderby = '';
|
||||
} elseif ( empty($_orderby) || 'id' == $_orderby ) {
|
||||
|
||||
Reference in New Issue
Block a user