From 45e8bef3cd5ccad43f90dc0cfbb2a13fba10df42 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 4 Sep 2015 21:17:26 +0000 Subject: [PATCH] In `get_terms()`, allow terms to be ordered by 'term_id'. [29128] introduced updated documentation for the `'orderby'` parameter of `get_terms()`. The new documentation mistakenly said that 'term_id' was a valid orderby value. The current changeset makes that fantasy...A REALITY. Props ixkaito. Fixes #33726. Built from https://develop.svn.wordpress.org/trunk@33903 git-svn-id: http://core.svn.wordpress.org/trunk@33872 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy-functions.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy-functions.php b/wp-includes/taxonomy-functions.php index 3e43f78479..8188a2ef7e 100644 --- a/wp-includes/taxonomy-functions.php +++ b/wp-includes/taxonomy-functions.php @@ -945,6 +945,7 @@ function get_term_to_edit( $id, $taxonomy ) { * * @since 2.3.0 * @since 4.2.0 Introduced 'name' and 'childless' parameters. + * @since 4.4.0 Introduced the ability to pass 'term_id' as an alias of 'id' for the `orderby` parameter. * * @global wpdb $wpdb WordPress database abstraction object. * @global array $wp_filter @@ -1132,7 +1133,7 @@ function get_terms( $taxonomies, $args = '' ) { $orderby = 'tt.description'; } elseif ( 'none' == $_orderby ) { $orderby = ''; - } elseif ( empty($_orderby) || 'id' == $_orderby ) { + } elseif ( empty( $_orderby ) || 'id' == $_orderby || 'term_id' === $_orderby ) { $orderby = 't.term_id'; } else { $orderby = 't.name'; diff --git a/wp-includes/version.php b/wp-includes/version.php index a72dbefb61..dcc0105738 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33902'; +$wp_version = '4.4-alpha-33903'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.