From 1d95eb63a77de461086f8427696c9c55765194c0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 10 Jun 2020 09:57:09 +0000 Subject: [PATCH] Docs: Add missing documentation for the `$group` parameter of `WP_Object_Cache::get_multiple()`. Synchronize documentation between `wp_cache_get_multiple()`, its compat version, and the class method. See #20875. Built from https://develop.svn.wordpress.org/trunk@47944 git-svn-id: http://core.svn.wordpress.org/trunk@47717 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/cache-compat.php | 15 ++++++++------- wp-includes/cache.php | 23 ++++++++++++----------- wp-includes/class-wp-object-cache.php | 24 ++++++++++++------------ wp-includes/version.php | 2 +- 4 files changed, 33 insertions(+), 31 deletions(-) diff --git a/wp-includes/cache-compat.php b/wp-includes/cache-compat.php index dc291fda07..d25017f2a1 100644 --- a/wp-includes/cache-compat.php +++ b/wp-includes/cache-compat.php @@ -10,21 +10,22 @@ if ( ! function_exists( 'wp_cache_get_multiple' ) ) : /** - * Compat function to mimic wp_cache_get_multiple. - * Retrieves multiple values from the cache. + * Retrieves multiple values from the cache in one call. + * + * Compat function to mimic wp_cache_get_multiple(). * * @ignore * @since 5.5.0 * * @see wp_cache_get_multiple() * - * @param array $keys Array of keys to fetch. - * @param bool $force Optional. Unused. Whether to force a refetch rather than relying on the local - * cache. Default false. - * + * @param array $keys Array of keys under which the cache contents are stored. + * @param string $group Optional. Where the cache contents are grouped. Default empty. + * @param bool $force Optional. Whether to force an update of the local cache + * from the persistent cache. Default false. * @return array Array of values organized into groups. */ - function wp_cache_get_multiple( $keys, $group = 'default', $force = false ) { + function wp_cache_get_multiple( $keys, $group = '', $force = false ) { $values = array(); foreach ( $keys as $key ) { diff --git a/wp-includes/cache.php b/wp-includes/cache.php index 23c5883ec0..4b6b004ac4 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -113,12 +113,11 @@ function wp_cache_flush() { * * @param int|string $key The key under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default empty. - * @param bool $force Optional. Whether to force an update of the local cache from the persistent - * cache. Default false. + * @param bool $force Optional. Whether to force an update of the local cache + * from the persistent cache. Default false. * @param bool $found Optional. Whether the key was found in the cache (passed by reference). * Disambiguates a return of false, a storable value. Default null. - * @return bool|mixed False on failure to retrieve contents or the cache - * contents on success + * @return mixed|false The cache contents on success, false on failure to retrieve contents. */ function wp_cache_get( $key, $group = '', $force = false, &$found = null ) { global $wp_object_cache; @@ -127,16 +126,18 @@ function wp_cache_get( $key, $group = '', $force = false, &$found = null ) { } /** - * Gets multiple values from cache in one call. + * Retrieves multiple values from the cache in one call. * * @since 5.5.0 - * @see WP_Object_Cache::get_multiple() * - * @param array $keys Array of keys to get from group. - * @param string $group Optional. Where the cache contents are grouped. Default empty. - * @param bool $force Optional. Whether to force an update of the local cache from the persistent - * cache. Default false. - * @return array|bool Array of values. + * @see WP_Object_Cache::get_multiple() + * @global WP_Object_Cache $wp_object_cache Object cache global instance. + * + * @param array $keys Array of keys under which the cache contents are stored. + * @param string $group Optional. Where the cache contents are grouped. Default empty. + * @param bool $force Optional. Whether to force an update of the local cache + * from the persistent cache. Default false. + * @return array Array of values organized into groups. */ function wp_cache_get_multiple( $keys, $group = '', $force = false ) { global $wp_object_cache; diff --git a/wp-includes/class-wp-object-cache.php b/wp-includes/class-wp-object-cache.php index 7a64cc4784..8a3362cedf 100644 --- a/wp-includes/class-wp-object-cache.php +++ b/wp-includes/class-wp-object-cache.php @@ -270,12 +270,12 @@ class WP_Object_Cache { * * @since 2.0.0 * - * @param int|string $key What the contents in the cache are called. - * @param string $group Optional. Where the cache contents are grouped. Default 'default'. - * @param bool $force Optional. Unused. Whether to force a refetch rather than relying on the local - * cache. Default false. - * @param bool $found Optional. Whether the key was found in the cache (passed by reference). - * Disambiguates a return of false, a storable value. Default null. + * @param int|string $key The key under which the cache contents are stored. + * @param string $group Optional. Where the cache contents are grouped. Default 'default'. + * @param bool $force Optional. Unused. Whether to force an update of the local cache + * from the persistent cache. Default false. + * @param bool $found Optional. Whether the key was found in the cache (passed by reference). + * Disambiguates a return of false, a storable value. Default null. * @return mixed|false The cache contents on success, false on failure to retrieve contents. */ public function get( $key, $group = 'default', $force = false, &$found = null ) { @@ -303,14 +303,14 @@ class WP_Object_Cache { } /** - * Retrieves multiple values from the cache. + * Retrieves multiple values from the cache in one call. * - * @since 5.5.0 - * - * @param array $keys Array of keys to fetch. - * @param bool $force Optional. Unused. Whether to force a refetch rather than relying on the local - * cache. Default false. + * @since 5.5.0 * + * @param array $keys Array of keys under which the cache contents are stored. + * @param string $group Optional. Where the cache contents are grouped. Default empty. + * @param bool $force Optional. Whether to force an update of the local cache + * from the persistent cache. Default false. * @return array Array of values organized into groups. */ public function get_multiple( $keys, $group = 'default', $force = false ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 0e0a83da0b..a50b3bd833 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47943'; +$wp_version = '5.5-alpha-47944'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.