Make WordPress Core


Ignore:
Timestamp:
02/11/2022 05:42:51 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Update DocBlocks for some object cache functions per the documentation standards.

Follow-up to [47060], [47938], [47944], [52700].

See #54729, #54574.

File:
1 edited

Legend:

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

    r52700 r52703  
    6060 *
    6161 * @param int|string $key    The cache key to decrement.
    62  * @param int        $offset Optional. The amount by which to decrement the item's value. Default 1.
     62 * @param int        $offset Optional. The amount by which to decrement the item's value.
     63 *                           Default 1.
    6364 * @param string     $group  Optional. The group the key is in. Default empty.
    6465 * @return int|false The item's new value on success, false on failure.
     
    146147}
    147148
    148 
    149 /**
    150  * Delete multiple values from the cache in one call.
     149/**
     150 * Deletes multiple values from the cache in one call.
    151151 *
    152152 * @since 6.0.0
     
    157157 * @param array  $keys  Array of keys under which the cache to deleted.
    158158 * @param string $group Optional. Where the cache contents are grouped. Default empty.
    159  * @return array Array of return values organized into groups.
     159 * @return array Array of return values.
    160160 */
    161161function wp_cache_delete_multiple( array $keys, $group = '' ) {
     
    166166
    167167/**
    168  * Add multiple values to the cache in one call.
     168 * Adds multiple values to the cache in one call.
    169169 *
    170170 * @since 6.0.0
     
    173173 * @global WP_Object_Cache $wp_object_cache Object cache global instance.
    174174 *
    175  * @param array  $data  Array of key and value to be set.
    176  * @param string $group Optional. Where the cache contents are grouped. Default empty.
     175 * @param array  $data   Array of keys and values to be set.
     176 * @param string $group  Optional. Where the cache contents are grouped. Default empty.
    177177 * @param int    $expire Optional. When to expire the cache contents, in seconds.
    178  *                           Default 0 (no expiration).
     178 *                       Default 0 (no expiration).
    179179 * @return array Array of return values.
    180180 */
     
    186186
    187187/**
    188  * Set multiple values to the cache in one call.
     188 * Sets multiple values to the cache in one call.
    189189 *
    190190 * @since 6.0.0
     
    193193 * @global WP_Object_Cache $wp_object_cache Object cache global instance.
    194194 *
    195  * @param array  $data  Array of key and value to be set.
    196  * @param string $group Optional. Where the cache contents are grouped. Default empty.
     195 * @param array  $data   Array of keys and values to be set.
     196 * @param string $group  Optional. Where the cache contents are grouped. Default empty.
    197197 * @param int    $expire Optional. When to expire the cache contents, in seconds.
    198  *                           Default 0 (no expiration).
     198 *                       Default 0 (no expiration).
    199199 * @return array Array of return values.
    200200 */
     
    206206
    207207/**
    208  * Increment numeric cache item's value
     208 * Increments numeric cache item's value.
    209209 *
    210210 * @since 3.3.0
     
    214214 *
    215215 * @param int|string $key    The key for the cache contents that should be incremented.
    216  * @param int        $offset Optional. The amount by which to increment the item's value. Default 1.
     216 * @param int        $offset Optional. The amount by which to increment the item's value.
     217 *                           Default 1.
    217218 * @param string     $group  Optional. The group the key is in. Default empty.
    218219 * @return int|false The item's new value on success, false on failure.
     
    249250 * @param int        $expire Optional. When to expire the cache contents, in seconds.
    250251 *                           Default 0 (no expiration).
    251  * @return bool False if original value does not exist, true if contents were replaced
     252 * @return bool True if contents were replaced, false if original value does not exist.
    252253 */
    253254function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
     
    336337 * function when preparing the cache for a blog switch. For clearing the cache
    337338 * during unit tests, consider using wp_cache_init(). wp_cache_init() is not
    338  * recommended outside of unit tests as the performance penalty for using it is
    339  * high.
     339 * recommended outside of unit tests as the performance penalty for using it is high.
    340340 *
    341341 * @since 2.6.0
Note: See TracChangeset for help on using the changeset viewer.