WordPress 函数:wp_cache_delete

根据 key 和 group 删除缓存。

用法

<?php wp_cache_delete($key, $group = ''); ?>

参数

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

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

返回值

(bool)
删除成功返回 true,否则返回 false。

注解

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

修改记录

Since 2.0.0

源文件

wp-includes/cache.php