$value ) { $values[ $key ] = wp_cache_add( $key, $value, $group, $expire ); } return $values; } endif; if ( ! function_exists( 'wp_cache_set_multiple' ) ) : /** * Set multiple values to the cache in one call. * * Differs from wp_cache_add_multiple() in that it will always write data. * * Compat function to mimic wp_cache_set_multiple(). * * @ignore * @since 6.0.0 * * @see wp_cache_set_multiple() * * @param array $data Array of key and value to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration). * @return array Array of return values. */ function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) { $values = array(); foreach ( $data as $key => $value ) { $values[ $key ] = wp_cache_set( $key, $value, $group, $expire ); } return $values; } endif;