From e23582cd09b7f37fab9d390681e6e46bdf7fa1a2 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: https://develop.svn.wordpress.org/trunk@22417 602fd350-edb4-49c9-b593-d223f7449a82 --- 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) ) {