Make WordPress Core


Ignore:
Timestamp:
09/10/2015 06:23:45 PM (9 years ago)
Author:
wonderboymusic
Message:

Clarify wp-includes/cache.php docs with some more precise language.

Props danielbachhuber.
Fixes #33734.

File:
1 edited

Legend:

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

    r33809 r34010  
    1616 * @global WP_Object_Cache $wp_object_cache
    1717 *
    18  * @param int|string $key The cache key to use for retrieval later
    19  * @param mixed $data The data to add to the cache store
    20  * @param string $group The group to add the cache to
    21  * @param int $expire When the cache data should be expired
    22  * @return bool False if cache key and group already exist, true on success
     18 * @param int|string $key The cache key to use for retrieval later.
     19 * @param mixed $data The data to add to the cache.
     20 * @param string $group The group to add the cache to. Enables the same key to be used across groups.
     21 * @param int $expire When the cache data should expire, in seconds. Default is 0 (no expiry).
     22 * @return bool False if cache key and group already exist, true on success.
    2323 */
    2424function wp_cache_add( $key, $data, $group = '', $expire = 0 ) {
     
    6969 * @global WP_Object_Cache $wp_object_cache
    7070 *
    71  * @param int|string $key What the contents in the cache are called
    72  * @param string $group Where the cache contents are grouped
    73  * @return bool True on successful removal, false on failure
     71 * @param int|string $key What the contents in the cache are called.
     72 * @param string $group Where the cache contents are grouped.
     73 * @return bool True on successful removal, false on failure.
    7474 */
    7575function wp_cache_delete($key, $group = '') {
     
    101101 * @global WP_Object_Cache $wp_object_cache
    102102 *
    103  * @param int|string $key What the contents in the cache are called
    104  * @param string $group Where the cache contents are grouped
    105  * @param bool $force Whether to force an update of the local cache from the persistent cache (default is false)
     103 * @param int|string $key The key under which the cache contents are stored.
     104 * @param string $group Where the cache contents are grouped.
     105 * @param bool $force Whether to force an update of the local cache from the persistent cache (default is false).
    106106 * @param bool &$found Whether key was found in the cache. Disambiguates a return of false, a storable value.
    107107 * @return bool|mixed False on failure to retrieve contents or the cache
     
    121121 * @global WP_Object_Cache $wp_object_cache
    122122 *
    123  * @param int|string $key The cache key to increment
     123 * @param int|string $key The key for the cache contents that should be incremented.
    124124 * @param int $offset The amount by which to increment the item's value. Default is 1.
    125125 * @param string $group The group the key is in.
     
    150150 * @global WP_Object_Cache $wp_object_cache
    151151 *
    152  * @param int|string $key What to call the contents in the cache
    153  * @param mixed $data The contents to store in the cache
    154  * @param string $group Where to group the cache contents
    155  * @param int $expire When to expire the cache contents
    156  * @return bool False if not exists, true if contents were replaced
     152 * @param int|string $key The key for the cache data that should be replaced.
     153 * @param mixed $data The new data to store in the cache.
     154 * @param string $group The group for the cache data that should be replaced.
     155 * @param int $expire When to expire the cache contents, in seconds. Defaults to 0 (no expiry).
     156 * @return bool False if original value does not exist, true if contents were replaced
    157157 */
    158158function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
     
    165165 * Saves the data to the cache.
    166166 *
    167  * @since 2.0.0
    168  *
    169  * @global WP_Object_Cache $wp_object_cache
    170  *
    171  * @param int|string $key What to call the contents in the cache
    172  * @param mixed $data The contents to store in the cache
    173  * @param string $group Where to group the cache contents
    174  * @param int $expire When to expire the cache contents
     167 * Differs from wp_cache_add() and wp_cache_replace() in that it will always write data.
     168 *
     169 * @since 2.0.0
     170 *
     171 * @global WP_Object_Cache $wp_object_cache
     172 *
     173 * @param int|string $key The cache key to use for retrieval later.
     174 * @param mixed $data The contents to store in the cache.
     175 * @param string $group Where to group the cache contents. Enables the same key to be used across groups.
     176 * @param int $expire When to expire the cache contents, in seconds. Defaults to 0 (no expiry).
    175177 * @return bool False on failure, true on success
    176178 */
Note: See TracChangeset for help on using the changeset viewer.