Taxonomy: Ensure the child_of argument of get_terms() works as expected with 'fields' => 'id=>name' or 'id=>slug'.

Props Howdy_McGee, deepaklalwani, planvova.
Fixes #46768.

git-svn-id: https://develop.svn.wordpress.org/trunk@48663 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-07-28 14:21:54 +00:00
parent faa6036d08
commit 6e66f08ec9
2 changed files with 79 additions and 2 deletions

View File

@@ -620,10 +620,10 @@ class WP_Term_Query {
$selects = array( 'COUNT(*)' );
break;
case 'id=>name':
$selects = array( 't.term_id', 't.name', 'tt.count', 'tt.taxonomy' );
$selects = array( 't.term_id', 't.name', 'tt.parent', 'tt.count', 'tt.taxonomy' );
break;
case 'id=>slug':
$selects = array( 't.term_id', 't.slug', 'tt.count', 'tt.taxonomy' );
$selects = array( 't.term_id', 't.slug', 'tt.parent', 'tt.count', 'tt.taxonomy' );
break;
}