wp_cache_set()添加一个数据到缓存中

目录

描述

Saves the data to the cache.

wp_cache_set() 描述

用法

<?php wp_cache_set$key$data$group$expire ); ?>

wp_cache_set() 用法

参数

$key

(int/string) (必填) the key to indicate the value.

默认值: None

$data

(mixed) (必填) The value you want to store.

默认值: None

$group

(string) (可选) this is a way of grouping data within the cache. Allows you to use the same key across different groups.

默认值: None

$expire

(integer) (可选) Defines how many seconds to keep the cache for. Defaults to 0 (as long as possible).

默认值: 0

wp_cache_set() 参数

历史

添加于 版本: 2.5.0

wp_cache_set() 历史

源文件

wp_cache_set() 函数的代码位于 wp-includes/cache.php.

wp_cache_set() 源文件

相关