Fix fields=names query in get_terms(). Props Sarky-de. fixes #5780

git-svn-id: http://svn.automattic.com/wordpress/trunk@6738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-06 20:42:03 +00:00
parent ab0ea44dc7
commit 6c312db33c
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}