diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index f2db5d81df..6313641d14 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1912,7 +1912,14 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { // Taxonomies registered without an 'args' param are handled here. if ( ! empty( $taxonomies ) ) { - $terms = array_merge( $terms, get_terms( $args ) ); + $terms_from_remaining_taxonomies = get_terms( $args ); + + // Array keys should be preserved for values of $fields that use term_id for keys. + if ( ! empty( $args['fields'] ) && 0 === strpos( $args['fields'], 'id=>' ) ) { + $terms = $terms + $terms_from_remaining_taxonomies; + } else { + $terms = array_merge( $terms, $terms_from_remaining_taxonomies ); + } } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index a08a164ba7..bd28f198fc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-beta1-41808'; +$wp_version = '4.9-beta1-41809'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.