From b7bab14e134d63f0e9eec1a9fab44a6dcff7a7a4 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@6738 602fd350-edb4-49c9-b593-d223f7449a82 --- 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); }