diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index 57f7cb9..258b397 100644
--- a/wp-includes/category-template.php
+++ b/wp-includes/category-template.php
@@ -1088,7 +1088,7 @@
 	$terms = get_object_term_cache( $post->ID, $taxonomy );
 	if ( false === $terms ) {
 		$terms = wp_get_object_terms( $post->ID, $taxonomy );
-		wp_cache_add($post->ID, $terms, $taxonomy . '_relationships');
+		wp_cache_add($post->ID, $terms, _get_taxonomy_cache_key( $taxonomy ) . '_relationships');
 	}
 
 	$terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy );
@@ -1127,7 +1127,8 @@
 		$term_links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>';
 	}
 
-	$term_links = apply_filters( "term_links-$taxonomy", $term_links );
+	$taxonomy_key = _get_taxonomy_cache_key( $taxonomy );
+	$term_links = apply_filters( "term_links-$taxonomy_key", $term_links );
 
 	return $before . join( $sep, $term_links ) . $after;
 }
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 06a9126..c3f6b4d 100644
--- a/wp-includes/taxonomy.php
+++ b/wp-includes/taxonomy.php
@@ -2317,7 +2317,7 @@
 				return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database' ), $wpdb->last_error );
 	}
 
-	wp_cache_delete( $object_id, $taxonomy . '_relationships' );
+	wp_cache_delete( $object_id, _get_taxonomy_cache_key( $taxonomy ) . '_relationships' );
 
 	do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids);
 	return $tt_ids;
@@ -2726,10 +2726,11 @@
 		$object_ids = array($object_ids);
 
 	$taxonomies = get_object_taxonomies( $object_type );
+	$taxonomy   = _get_taxonomy_cache_key( $taxonomies );
 
-	foreach ( $object_ids as $id )
-		foreach ( $taxonomies as $taxonomy )
-			wp_cache_delete($id, "{$taxonomy}_relationships");
+	foreach ( $object_ids as $id ) {
+		wp_cache_delete( $id, "{$taxonomy}_relationships" );
+	}
 
 	do_action('clean_object_term_cache', $object_ids, $object_type);
 }
@@ -2808,6 +2809,7 @@
  * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id.
  */
 function get_object_term_cache($id, $taxonomy) {
+	$taxonomy = _get_taxonomy_cache_key( $taxonomy );
 	$cache = wp_cache_get($id, "{$taxonomy}_relationships");
 	return $cache;
 }
@@ -2844,14 +2846,13 @@
 	$object_ids = array_map('intval', $object_ids);
 
 	$taxonomies = get_object_taxonomies($object_type);
+	$taxonomy_key = _get_taxonomy_cache_key( $taxonomies );
 
 	$ids = array();
 	foreach ( (array) $object_ids as $id ) {
-		foreach ( $taxonomies as $taxonomy ) {
-			if ( false === wp_cache_get($id, "{$taxonomy}_relationships") ) {
-				$ids[] = $id;
-				break;
-			}
+		if ( false === wp_cache_get($id, "{$taxonomy_key}_relationships") ) {
+			$ids[] = $id;
+			break;
 		}
 	}
 
@@ -2865,19 +2866,15 @@
 		$object_terms[$term->object_id][$term->taxonomy][$term->term_id] = $term;
 
 	foreach ( $ids as $id ) {
-		foreach ( $taxonomies as $taxonomy ) {
-			if ( ! isset($object_terms[$id][$taxonomy]) ) {
-				if ( !isset($object_terms[$id]) )
-					$object_terms[$id] = array();
-				$object_terms[$id][$taxonomy] = array();
-			}
+		if ( ! isset($object_terms[$id][$taxonomy_key]) ) {
+			if ( !isset($object_terms[$id]) )
+				$object_terms[$id] = array();
+			$object_terms[$id][$taxonomy_key] = array();
 		}
 	}
 
 	foreach ( $object_terms as $id => $value ) {
-		foreach ( $value as $taxonomy => $terms ) {
-			wp_cache_add( $id, $terms, "{$taxonomy}_relationships" );
-		}
+		wp_cache_add( $id, $terms, "{$taxonomy_key}_relationships" );
 	}
 }
 
