Summery Summery
Increments numeric cache item’s value.
Syntax Syntax
Parameters Parameters
- $key
-
(Required) The cache key to increment
- $offset
-
(Optional) The amount by which to increment the item's value.
Default value: 1
- $group
-
(Optional) The group the key is in. Default 'default'.
Default value: 'default'
Return Return
(int|false) The item's new value on success, false on failure.
Source Source
File: wp-includes/class-wp-object-cache.php
*/
public function get_multiple( $keys, $group = 'default', $force = false ) {
$values = array();
foreach ( $keys as $key ) {
$values[ $key ] = $this->get( $key, $group, $force );
}
return $values;
}
/**
* Increments numeric cache item's value.
*
* @since 3.3.0
*
* @param int|string $key The cache key to increment
* @param int $offset Optional. The amount by which to increment the item's value. Default 1.
* @param string $group Optional. The group the key is in. Default 'default'.
* @return int|false The item's new value on success, false on failure.
*/
public function incr( $key, $offset = 1, $group = 'default' ) {
if ( empty( $group ) ) {
$group = 'default';
}
if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 3.3.0 | Introduced. |