From 6c312db33c83faec632c1a8d0b60634c1a85c37c Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 6 Feb 2008 20:42:03 +0000 Subject: [PATCH] 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 --- wp-includes/taxonomy.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 1cd15ab91f..c3ab070c2f 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -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); }