setTransientWithUser() public static method

You do not need to serialize values. If the value needs to be serialized, then it will be serialized before it is set.
Since: 1.3.0
public static setTransientWithUser ( string $transient, mixed $value, integer $expiration, integer $user_id = null ) : boolean
$transient string Transient name. Expected to not be SQL-escaped.
$value mixed Transient value. Expected to not be SQL-escaped.
$expiration integer Time until expiration in seconds, default 0
$user_id integer Optional. User ID. If null the current user id is used instead
return boolean False if value was not set and true if value was set.
Beispiel #1
0
 /**
  * Set/update the value of a user transient.
  *
  * You do not need to serialize values. If the value needs to be serialized, then it will be serialized before it is
  * set.
  *
  * @brief      Set
  * @since      1.0.0
  * @deprecated since 1.3.0 - Use WPDKUser::setTransientWithUser() instead
  *
  * @uses       apply_filters() Calls 'pre_set_user_transient_$transient' hook to allow overwriting the transient value
  *             to be stored.
  * @uses       do_action() Calls 'set_user_transient_$transient' and 'setted_transient' hooks on success.
  *
  * @param string $transient  Transient name. Expected to not be SQL-escaped.
  * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
  * @param int    $expiration Time until expiration in seconds, default 0
  * @param int    $user_id    Optional. User ID. If null the current user id is used instead
  *
  * @return bool False if value was not set and true if value was set.
  */
 function wpdk_set_user_transient($transient, $value, $expiration = 0, $user_id = null)
 {
     _deprecated_function(__CLASS__ . '::' . __FUNCTION__, '1.3.0', 'WPDKUser::setTransientWithUser()');
     return WPDKUser::setTransientWithUser($transient, $value, $expiration, $user_id);
 }