+ $GLOBALS['wp_object_cache'] = new WP_Object_Cache();
+}
+
+/**
+ * Replaces the contents of the cache with new data.
+ *
+ * @since 2.0.0
+ *
+ * @see WP_Object_Cache::replace()
+ * @global WP_Object_Cache $wp_object_cache Object cache global instance.
+ *
+ * @param int|string $key The key for the cache data that should be replaced.
+ * @param mixed $data The new data to store in the cache.
+ * @param string $group Optional. The group for the cache data that should be replaced.
+ * Default empty.
+ * @param int $expire Optional. When to expire the cache contents, in seconds.
+ * Default 0 (no expiration).
+ * @return bool False if original value does not exist, true if contents were replaced
+ */
+function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
+ global $wp_object_cache;
+
+ return $wp_object_cache->replace( $key, $data, $group, (int) $expire );
+}
+
+/**
+ * Saves the data to the cache.
+ *
+ * Differs from wp_cache_add() and wp_cache_replace() in that it will always write data.
+ *
+ * @since 2.0.0
+ *
+ * @see WP_Object_Cache::set()
+ * @global WP_Object_Cache $wp_object_cache Object cache global instance.
+ *
+ * @param int|string $key The cache key to use for retrieval later.
+ * @param mixed $data The contents to store in the cache.
+ * @param string $group Optional. Where to group the cache contents. Enables the same key
+ * to be used across groups. Default empty.
+ * @param int $expire Optional. When to expire the cache contents, in seconds.
+ * Default 0 (no expiration).
+ * @return bool False on failure, true on success
+ */
+function wp_cache_set( $key, $data, $group = '', $expire = 0 ) {