Summery Summery

Sets/updates the value of a transient.

Syntax Syntax

set_transient( string $transient, mixed $value, int $expiration )

Description Description

You do not need to serialize values. If the value needs to be serialized, then it will be serialized before it is set.

Parameters Parameters


(string) (Required) Transient name. Expected to not be SQL-escaped. Must be 172 characters or fewer in length.


(mixed) (Required) Transient value. Must be serializable if non-scalar. Expected to not be SQL-escaped.


(int) (Optional) Time until expiration in seconds. Default 0 (no expiration).

Return Return

(bool) False if value was not set and true if value was set.

Source Source

File: wp-includes/option.php



Changelog Changelog

Version Description
2.8.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.