Index: src/wp-includes/taxonomy.php
--- src/wp-includes/taxonomy.php
+++ src/wp-includes/taxonomy.php
@@ -1657,9 +1657,7 @@
  */
 function get_terms( $taxonomies, $args = '' ) {
 	global $wpdb;
-	$empty_array = array();
 
-	$single_taxonomy = ! is_array( $taxonomies ) || 1 === count( $taxonomies );
 	if ( ! is_array( $taxonomies ) ) {
 		$taxonomies = array( $taxonomies );
 	}
@@ -1675,9 +1673,9 @@
 		'number' => '', 'fields' => 'all', 'name' => '', 'slug' => '', 'parent' => '', 'childless' => false,
 		'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 'description__like' => '',
 		'pad_counts' => false, 'offset' => '', 'search' => '', 'cache_domain' => 'core' );
-	$args = wp_parse_args( $args, $defaults );
-	$args['number'] = absint( $args['number'] );
-	$args['offset'] = absint( $args['offset'] );
+	$r = wp_parse_args( $args, $defaults );
+	$r['number'] = absint( $r['number'] );
+	$r['offset'] = absint( $r['offset'] );
 
 	// Save queries by not crawling the tree in the case of multiple taxes or a flat tax.
 	$has_hierarchical_tax = false;
@@ -1688,21 +1686,21 @@
 	}
 
 	if ( ! $has_hierarchical_tax ) {
-		$args['hierarchical'] = false;
-		$args['pad_counts'] = false;
+		$r['hierarchical'] = false;
+		$r['pad_counts'] = false;
 	}
 
 	// 'parent' overrides 'child_of'.
-	if ( 0 < intval( $args['parent'] ) ) {
-		$args['child_of'] = false;
+	if ( 0 < intval( $r['parent'] ) ) {
+		$r['child_of'] = false;
 	}
 
-	if ( 'all' == $args['get'] ) {
-		$args['childless'] = false;
-		$args['child_of'] = 0;
-		$args['hide_empty'] = 0;
-		$args['hierarchical'] = false;
-		$args['pad_counts'] = false;
+	if ( 'all' == $r['get'] ) {
+		$r['childless'] = false;
+		$r['child_of'] = 0;
+		$r['hide_empty'] = 0;
+		$r['hierarchical'] = false;
+		$r['pad_counts'] = false;
 	}
 
 	/**
@@ -1710,14 +1708,15 @@
 	 *
 	 * @since 3.1.0
 	 *
-	 * @param array $args       An array of get_term() arguments.
+	 * @param array $r          An array of modified get_terms() arguments.
 	 * @param array $taxonomies An array of taxonomies.
+	 * @param array $args       An array of original get_terms() arguments.
 	 */
-	$args = apply_filters( 'get_terms_args', $args, $taxonomies );
+	$r = apply_filters( 'get_terms_args', $r, $taxonomies, $args );
 
 	// Avoid the query if the queried parent/child_of term has no descendants.
-	$child_of = $args['child_of'];
-	$parent   = $args['parent'];
+	$child_of = $r['child_of'];
+	$parent   = $r['parent'];
 
 	if ( $child_of ) {
 		$_parent = $child_of;
@@ -1738,13 +1737,13 @@
 		}
 
 		if ( ! $in_hierarchy ) {
-			return $empty_array;
+			return array();
 		}
 	}
 
-	// $args can be whatever, only use the args defined in defaults to compute the key.
+	// $r can be whatever, only use the args defined in defaults to compute the key.
 	$filter_key = ( has_filter('list_terms_exclusions') ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : '';
-	$key = md5( serialize( wp_array_slice_assoc( $args, array_keys( $defaults ) ) ) . serialize( $taxonomies ) . $filter_key );
+	$key = md5( serialize( wp_array_slice_assoc( $r, array_keys( $defaults ) ) ) . serialize( $taxonomies ) . $filter_key );
 	$last_changed = wp_cache_get( 'last_changed', 'terms' );
 	if ( ! $last_changed ) {
 		$last_changed = microtime();
@@ -1761,20 +1760,21 @@
 		 *
 		 * @param array $cache      Cached array of terms for the given taxonomy.
 		 * @param array $taxonomies An array of taxonomies.
-		 * @param array $args       An array of get_terms() arguments.
+		 * @param array $r          An array of modified get_terms() arguments.
+		 * @param array $args       An array of original get_terms() arguments.
 		 */
-		return apply_filters( 'get_terms', $cache, $taxonomies, $args );
+		return apply_filters( 'get_terms', $cache, $taxonomies, $r, $args );
 	}
 
-	$_orderby = strtolower( $args['orderby'] );
+	$_orderby = strtolower( $r['orderby'] );
 	if ( 'count' == $_orderby ) {
 		$orderby = 'tt.count';
 	} elseif ( 'name' == $_orderby ) {
 		$orderby = 't.name';
 	} elseif ( 'slug' == $_orderby ) {
 		$orderby = 't.slug';
-	} elseif ( 'include' == $_orderby && ! empty( $args['include'] ) ) {
-		$include = implode( ',', array_map( 'absint', $args['include'] ) );
+	} elseif ( 'include' == $_orderby && ! empty( $r['include'] ) ) {
+		$include = implode( ',', array_map( 'absint', $r['include'] ) );
 		$orderby = "FIELD( t.term_id, $include )";
 	} elseif ( 'term_group' == $_orderby ) {
 		$orderby = 't.term_group';
@@ -1794,12 +1794,13 @@
 	 * @since 2.8.0
 	 *
 	 * @param string $orderby    `ORDERBY` clause of the terms query.
-	 * @param array  $args       An array of terms query arguments.
+	 * @param array  $r          An array of modified get_terms() arguments.
 	 * @param array  $taxonomies An array of taxonomies.
+	 * @param array  $args       An array of original get_terms() arguments.
 	 */
-	$orderby = apply_filters( 'get_terms_orderby', $orderby, $args, $taxonomies );
+	$orderby = apply_filters( 'get_terms_orderby', $orderby, $r, $taxonomies, $args );
 
-	$order = strtoupper( $args['order'] );
+	$order = strtoupper( $r['order'] );
 	if ( ! empty( $orderby ) ) {
 		$orderby = "ORDER BY $orderby";
 	} else {
@@ -1812,9 +1813,9 @@
 
 	$where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
 
-	$exclude = $args['exclude'];
-	$exclude_tree = $args['exclude_tree'];
-	$include = $args['include'];
+	$exclude = $r['exclude'];
+	$exclude_tree = $r['exclude_tree'];
+	$include = $r['include'];
 
 	$inclusions = '';
 	if ( ! empty( $include ) ) {
@@ -1846,7 +1847,7 @@
 	}
 
 	// 'childless' terms are those without an entry in the flattened term hierarchy.
-	$childless = (bool) $args['childless'];
+	$childless = (bool) $r['childless'];
 	if ( $childless ) {
 		foreach ( $taxonomies as $_tax ) {
 			$term_hierarchy = _get_term_hierarchy( $_tax );
@@ -1866,17 +1867,18 @@
 	 * @since 2.3.0
 	 *
 	 * @param string $exclusions `NOT IN` clause of the terms query.
-	 * @param array  $args       An array of terms query arguments.
+	 * @param array  $r          An array of modified get_terms() arguments.
 	 * @param array  $taxonomies An array of taxonomies.
+	 * @param array  $args       An array of original get_terms() arguments.
 	 */
-	$exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args, $taxonomies );
+	$exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $r, $taxonomies, $args );
 
 	if ( ! empty( $exclusions ) ) {
 		$where .= $exclusions;
 	}
 
-	if ( ! empty( $args['name'] ) ) {
-		$names = (array) $args['name'];
+	if ( ! empty( $r['name'] ) ) {
+		$names = (array) $r['name'];
 		foreach ( $names as &$_name ) {
 			$_name = sanitize_term_field( 'name', $_name, 0, reset( $taxonomies ), 'db' );
 		}
@@ -1884,22 +1886,22 @@
 		$where .= " AND t.name IN ('" . implode( "', '", array_map( 'esc_sql', $names ) ) . "')";
 	}
 
-	if ( ! empty( $args['slug'] ) ) {
-		if ( is_array( $args['slug'] ) ) {
-			$slug = array_map( 'sanitize_title', $args['slug'] );
+	if ( ! empty( $r['slug'] ) ) {
+		if ( is_array( $r['slug'] ) ) {
+			$slug = array_map( 'sanitize_title', $r['slug'] );
 			$where .= " AND t.slug IN ('" . implode( "', '", $slug ) . "')";
 		} else {
-			$slug = sanitize_title( $args['slug'] );
+			$slug = sanitize_title( $r['slug'] );
 			$where .= " AND t.slug = '$slug'";
 		}
 	}
 
-	if ( ! empty( $args['name__like'] ) ) {
-		$where .= $wpdb->prepare( " AND t.name LIKE %s", '%' . $wpdb->esc_like( $args['name__like'] ) . '%' );
+	if ( ! empty( $r['name__like'] ) ) {
+		$where .= $wpdb->prepare( " AND t.name LIKE %s", '%' . $wpdb->esc_like( $r['name__like'] ) . '%' );
 	}
 
-	if ( ! empty( $args['description__like'] ) ) {
-		$where .= $wpdb->prepare( " AND tt.description LIKE %s", '%' . $wpdb->esc_like( $args['description__like'] ) . '%' );
+	if ( ! empty( $r['description__like'] ) ) {
+		$where .= $wpdb->prepare( " AND tt.description LIKE %s", '%' . $wpdb->esc_like( $r['description__like'] ) . '%' );
 	}
 
 	if ( '' !== $parent ) {
@@ -1907,16 +1909,16 @@
 		$where .= " AND tt.parent = '$parent'";
 	}
 
-	$hierarchical = $args['hierarchical'];
-	if ( 'count' == $args['fields'] ) {
+	$hierarchical = $r['hierarchical'];
+	if ( 'count' == $r['fields'] ) {
 		$hierarchical = false;
 	}
-	if ( $args['hide_empty'] && !$hierarchical ) {
+	if ( $r['hide_empty'] && !$hierarchical ) {
 		$where .= ' AND tt.count > 0';
 	}
 
-	$number = $args['number'];
-	$offset = $args['offset'];
+	$number = $r['number'];
+	$offset = $r['offset'];
 
 	// Don't limit the query results when we have to descend the family tree.
 	if ( $number && ! $hierarchical && ! $child_of && '' === $parent ) {
@@ -1929,13 +1931,13 @@
 		$limits = '';
 	}
 
-	if ( ! empty( $args['search'] ) ) {
-		$like = '%' . $wpdb->esc_like( $args['search'] ) . '%';
+	if ( ! empty( $r['search'] ) ) {
+		$like = '%' . $wpdb->esc_like( $r['search'] ) . '%';
 		$where .= $wpdb->prepare( ' AND ((t.name LIKE %s) OR (t.slug LIKE %s))', $like, $like );
 	}
 
 	$selects = array();
-	switch ( $args['fields'] ) {
+	switch ( $r['fields'] ) {
 		case 'all':
 			$selects = array( 't.*', 'tt.*' );
 			break;
@@ -1959,7 +1961,7 @@
 			break;
 	}
 
-	$_fields = $args['fields'];
+	$_fields = $r['fields'];
 
 	/**
 	 * Filter the fields to select in the terms query.
@@ -1974,10 +1976,11 @@
 	 * @since 2.8.0
 	 *
 	 * @param array $selects    An array of fields to select for the terms query.
-	 * @param array $args       An array of term query arguments.
+	 * @param array $r          An array of modified get_terms() arguments.
 	 * @param array $taxonomies An array of taxonomies.
+	 * @param array $args       An array of original get_terms() arguments.
 	 */
-	$fields = implode( ', ', apply_filters( 'get_terms_fields', $selects, $args, $taxonomies ) );
+	$fields = implode( ', ', apply_filters( 'get_terms_fields', $selects, $r, $taxonomies, $args ) );
 
 	$join = "INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id";
 
@@ -1990,9 +1993,10 @@
 	 *
 	 * @param array $pieces     Terms query SQL clauses.
 	 * @param array $taxonomies An array of taxonomies.
-	 * @param array $args       An array of terms query arguments.
+	 * @param array $r          An array of modified get_terms() arguments.
+	 * @param array $args       An array of original get_terms() arguments.
 	 */
-	$clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args );
+	$clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $r, $args );
 
 	$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
 	$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
@@ -2016,7 +2020,7 @@
 		wp_cache_add( $cache_key, array(), 'terms', DAY_IN_SECONDS );
 
 		/** This filter is documented in wp-includes/taxonomy.php */
-		return apply_filters( 'get_terms', array(), $taxonomies, $args );
+		return apply_filters( 'get_terms', array(), $taxonomies, $r, $args );
 	}
 
 	if ( $child_of ) {
@@ -2029,14 +2033,14 @@
 	}
 
 	// Update term counts to include children.
-	if ( $args['pad_counts'] && 'all' == $_fields ) {
+	if ( $r['pad_counts'] && 'all' == $_fields ) {
 		foreach ( $taxonomies as $_tax ) {
 			_pad_term_counts( $terms, $_tax );
 		}
 	}
 
 	// Make sure we show empty categories that have children.
-	if ( $hierarchical && $args['hide_empty'] && is_array( $terms ) ) {
+	if ( $hierarchical && $r['hide_empty'] && is_array( $terms ) ) {
 		foreach ( $terms as $k => $term ) {
 			if ( ! $term->count ) {
 				$children = get_term_children( $term->term_id, $term->taxonomy );
@@ -2089,7 +2093,7 @@
 	wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
 
 	/** This filter is documented in wp-includes/taxonomy */
-	return apply_filters( 'get_terms', $terms, $taxonomies, $args );
+	return apply_filters( 'get_terms', $terms, $taxonomies, $r, $args );
 }
 
 /**
