Make WordPress Core

Changeset 47944


Ignore:
Timestamp:
06/10/2020 09:55:56 AM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/cache-compat.php

    r47939 r47944  
    1111if ( ! function_exists( 'wp_cache_get_multiple' ) ) :
    1212    /**
    13      * Compat function to mimic wp_cache_get_multiple.
    14      * Retrieves multiple values from the cache.
     13     * Retrieves multiple values from the cache in one call.
     14     *
     15     * Compat function to mimic wp_cache_get_multiple().
    1516     *
    1617     * @ignore
     
    1920     * @see wp_cache_get_multiple()
    2021     *
    21      * @param array $keys        Array of keys to fetch.
    22      * @param bool  $force       Optional. Unused. Whether to force a refetch rather than relying on the local
    23      *                           cache. Default false.
    24      *
     22     * @param array  $keys  Array of keys under which the cache contents are stored.
     23     * @param string $group Optional. Where the cache contents are grouped. Default empty.
     24     * @param bool   $force Optional. Whether to force an update of the local cache
     25     *                      from the persistent cache. Default false.
    2526     * @return array Array of values organized into groups.
    2627     */
    27     function wp_cache_get_multiple( $keys, $group = 'default', $force = false ) {
     28    function wp_cache_get_multiple( $keys, $group = '', $force = false ) {
    2829        $values = array();
    2930
  • trunk/src/wp-includes/cache.php

    r47938 r47944  
    114114 * @param int|string  $key    The key under which the cache contents are stored.
    115115 * @param string      $group  Optional. Where the cache contents are grouped. Default empty.
    116  * @param bool        $force  Optional. Whether to force an update of the local cache from the persistent
    117  *                            cache. Default false.
     116 * @param bool        $force  Optional. Whether to force an update of the local cache
     117 *                            from the persistent cache. Default false.
    118118 * @param bool        $found  Optional. Whether the key was found in the cache (passed by reference).
    119119 *                            Disambiguates a return of false, a storable value. Default null.
    120  * @return bool|mixed False on failure to retrieve contents or the cache
    121  *                    contents on success
     120 * @return mixed|false The cache contents on success, false on failure to retrieve contents.
    122121 */
    123122function wp_cache_get( $key, $group = '', $force = false, &$found = null ) {
     
    128127
    129128/**
    130  * Gets multiple values from cache in one call.
     129 * Retrieves multiple values from the cache in one call.
    131130 *
    132131 * @since 5.5.0
     132 *
    133133 * @see WP_Object_Cache::get_multiple()
    134  *
    135  * @param array       $keys   Array of keys to get from group.
    136  * @param string      $group  Optional. Where the cache contents are grouped. Default empty.
    137  * @param bool        $force  Optional. Whether to force an update of the local cache from the persistent
    138  *                            cache. Default false.
    139  * @return array|bool Array of values.
     134 * @global WP_Object_Cache $wp_object_cache Object cache global instance.
     135 *
     136 * @param array  $keys  Array of keys under which the cache contents are stored.
     137 * @param string $group Optional. Where the cache contents are grouped. Default empty.
     138 * @param bool   $force Optional. Whether to force an update of the local cache
     139 *                      from the persistent cache. Default false.
     140 * @return array Array of values organized into groups.
    140141 */
    141142function wp_cache_get_multiple( $keys, $group = '', $force = false ) {
  • trunk/src/wp-includes/class-wp-object-cache.php

    r47938 r47944  
    271271     * @since 2.0.0
    272272     *
    273      * @param int|string $key    What the contents in the cache are called.
    274      * @param string     $group  Optional. Where the cache contents are grouped. Default 'default'.
    275      * @param bool       $force  Optional. Unused. Whether to force a refetch rather than relying on the local
    276      *                          cache. Default false.
    277      * @param bool       $found  Optional. Whether the key was found in the cache (passed by reference).
    278      *                           Disambiguates a return of false, a storable value. Default null.
     273     * @param int|string $key   The key under which the cache contents are stored.
     274     * @param string     $group Optional. Where the cache contents are grouped. Default 'default'.
     275     * @param bool       $force Optional. Unused. Whether to force an update of the local cache
     276     *                          from the persistent cache. Default false.
     277     * @param bool       $found Optional. Whether the key was found in the cache (passed by reference).
     278     *                          Disambiguates a return of false, a storable value. Default null.
    279279     * @return mixed|false The cache contents on success, false on failure to retrieve contents.
    280280     */
     
    304304
    305305    /**
    306      * Retrieves multiple values from the cache.
    307      *
    308      * @since  5.5.0
    309      *
    310      * @param array $keys        Array of keys to fetch.
    311      * @param bool  $force       Optional. Unused. Whether to force a refetch rather than relying on the local
    312      *                           cache. Default false.
    313      *
     306     * Retrieves multiple values from the cache in one call.
     307     *
     308     * @since 5.5.0
     309     *
     310     * @param array  $keys  Array of keys under which the cache contents are stored.
     311     * @param string $group Optional. Where the cache contents are grouped. Default empty.
     312     * @param bool   $force Optional. Whether to force an update of the local cache
     313     *                      from the persistent cache. Default false.
    314314     * @return array Array of values organized into groups.
    315315     */
Note: See TracChangeset for help on using the changeset viewer.