Index: src/wp-includes/cache-compat.php
===================================================================
--- src/wp-includes/cache-compat.php	(revision 0)
+++ src/wp-includes/cache-compat.php	(working copy)
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ *  Compatibility for cache drop-ins.
+ *
+ * @param $groups
+ * @since 5.0.0
+ * @return array
+ */
+function wp_cache_get_multiple( $groups ) {
+	$values = array();
+
+	foreach ( $groups as $group => $keys ) {
+		foreach ( $keys as $key ) {
+			$values[ $group ][ $key ] = wp_cache_get( $key, $group );
+		}
+	}
+
+	return $values;
+}
+
+
+

Property changes on: src/wp-includes/cache-compat.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/wp-includes/cache.php
===================================================================
--- src/wp-includes/cache.php	(revision 42404)
+++ src/wp-includes/cache.php	(working copy)
@@ -124,6 +124,22 @@
 }
 
 /**
+ * Gets multiple values from cache in one call.
+ *
+ * @since 5.0.0
+ * @uses $wp_object_cache Object Cache Class
+ *
+ * @param array $groups Multidimensional array, where the array keys are cache group names,
+ *                      and the values are arrays of keys to be fetched from that group.
+ * @return array|bool Array of values organized into groups.
+ */
+function wp_cache_get_multiple( $groups ) {
+	global $wp_object_cache;
+
+	return $wp_object_cache->get_multiple( $groups );
+}
+
+/**
  * Increment numeric cache item's value
  *
  * @since 3.3.0
@@ -557,6 +573,28 @@
 	}
 
 	/**
+	 * Retrieves multiple values from the cache.
+	 *
+	 * @since 5.0.0
+	 * @access public
+	 *
+	 * @param array $groups Multidimensional array, where the array keys are cache group names,
+	 *                      and the values are arrays of keys to be fetched from that group.
+	 * @return array Array of values organized into groups.
+	 */
+	public function get_multiple( $groups ) {
+		$values = array();
+
+		foreach ( $groups as $group => $keys ) {
+			foreach ( $keys as $key ) {
+				$values[ $group ][ $key ] = $this->get( $key, $group );
+			}
+		}
+
+		return $values;
+	}
+
+	/**
 	 * Increments numeric cache item's value.
 	 *
 	 * @since 3.3.0
Index: src/wp-includes/load.php
===================================================================
--- src/wp-includes/load.php	(revision 42404)
+++ src/wp-includes/load.php	(working copy)
@@ -570,6 +570,10 @@
 		wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'site-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites' ) );
 		wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );
 	}
+
+	if ( ! function_exists( 'wp_cache_get_multiple' ) ) {
+		require_once( ABSPATH . WPINC . '/cache-compat.php' );
+	}
 }
 
 /**
Index: tests/phpunit/tests/cache.php
===================================================================
--- tests/phpunit/tests/cache.php	(revision 42404)
+++ tests/phpunit/tests/cache.php	(working copy)
@@ -315,4 +315,37 @@
 		// Make sure $fake_key is not stored
 		$this->assertFalse( wp_cache_get( $fake_key ) );
 	}
+
+	/**
+	 * @ticket 20875
+	 */
+	public function test_get_multiple() {
+		wp_cache_set( 'foo1', 'bar', 'group1' );
+		wp_cache_set( 'foo2', 'bar', 'group1' );
+		wp_cache_set( 'foo1', 'bar', 'group2' );
+
+		$found = wp_cache_get_multiple( array(
+			'group1' => array(
+				'foo1',
+				'foo2',
+				'foo3',
+			),
+			'group2' => array(
+				'foo1',
+			),
+		) );
+
+		$expected = array(
+			'group1' => array(
+				'foo1' => 'bar',
+				'foo2' => 'bar',
+				'foo3' => false,
+			),
+			'group2' => array(
+				'foo1' => 'bar',
+			),
+		);
+
+		$this->assertSame( $expected, $found );
+	}
 }
