WordPress 函数:wp_cache_incr

递增数字缓存项的值。

用法

<?php wp_cache_incr( $key, $offset = 1, $group = '' ); ?>

参数

$key
(int|string) (required) 数字缓存中的名字
Default: 无

$offset
(int) (optional) 每次递增的值。
Default: 1

$group
(string) (optional) 数字缓存的组名。
Default: 'default'

返回值

(bool|int)
失败返回 false,否则返回递增之后的数据。

注解

  • 使用到 wp_object_cache 对象缓存的类
  • WP_Object_Cache::incr()

修改记录

Since 3.3.0

源文件

wp-includes/cache.php