set_transient
set_transient ( $transient, $value, $expiration = 0 )
Parameters:- (string) transient Transient name. Expected to not be SQL-escaped. Must be 172 characters or fewer in length.
- (mixed) value Transient value. Must be serializable if non-scalar. Expected to not be SQL-escaped.
- (int) expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
Returns:- (bool) True if the value was set, false otherwise.
Defined at: - Introduced in WordPress: 2.8.0
- Deprecated in WordPress: —
Description
Sets/updates the value of a transient.You do not need to serialize values. If the value needs to be serialized,
then it will be serialized before it is set.