From 711f6f2619f4bc92d67fd1ba369e2fb42030640a Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 7 Nov 2012 09:03:40 +0000 Subject: [PATCH] Treat a single taxonomy passed as an array the same as when passed as a string in get_terms(). props wonderboymusic, fixes #17955. git-svn-id: http://core.svn.wordpress.org/trunk@22417 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 1e06fe4a67..5dcce3a3c2 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1188,11 +1188,9 @@ function get_terms($taxonomies, $args = '') { global $wpdb; $empty_array = array(); - $single_taxonomy = false; - if ( !is_array($taxonomies) ) { - $single_taxonomy = true; - $taxonomies = array($taxonomies); - } + $single_taxonomy = ! is_array( $taxonomies ) || 1 === count( $taxonomies ); + if ( ! is_array( $taxonomies ) ) + $taxonomies = array( $taxonomies ); foreach ( $taxonomies as $taxonomy ) { if ( ! taxonomy_exists($taxonomy) ) {