WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp cache set

Description

Saves the data to the cache.

Usage

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

Parameters

$key
(int/string) (required) the key to indicate the value.
Default: None
$data
(mixed) (required) The value you want to store.
Default: None
$group
(string) (optional) this is a way of grouping data within the cache. Allows you to use the same key across different groups.
Default: None
$expire
(integer) (optional) Defines how many seconds to keep the cache for. Defaults to 0 (as long as possible).
Default: 0

Return

Always returns true

Change Log

Since: 2.5.0

Source File

wp_cache_set() is located in wp-includes/cache.php.

Related

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.