mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01:00
Fix fields=names query in get_terms(). Props Sarky-de. fixes #5780
git-svn-id: https://develop.svn.wordpress.org/trunk@6738 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
69e33afad3
commit
b7bab14e13
@ -640,14 +640,14 @@ function &get_terms($taxonomies, $args = '') {
|
||||
else if ( 'ids' == $fields )
|
||||
$select_this = 't.term_id';
|
||||
else if ( 'names' == $fields )
|
||||
$select_this == 't.name';
|
||||
$select_this = 't.name';
|
||||
|
||||
$query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $number";
|
||||
|
||||
if ( 'all' == $fields ) {
|
||||
$terms = $wpdb->get_results($query);
|
||||
update_term_cache($terms);
|
||||
} else if ( 'ids' == $fields ) {
|
||||
} else if ( ('ids' == $fields) || ('names' == $fields) ) {
|
||||
$terms = $wpdb->get_col($query);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user