set_site_transient

The timeline below displays how wordpress function set_site_transient has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 9.1

/**
 * Sets/updates the value of a site transient.
 *
 * You do not need to serialize values. If the value needs to be serialized,
 * then it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           167 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
 * @return bool True if the value was set, false otherwise.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filters the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     * @since 4.4.0 The `$transient` parameter was added.
     *
     * @param mixed  $value     New value of site transient.
     * @param string $transient Transient name.
     */
    $value = apply_filters("pre_set_site_transient_{$transient}", $value, $transient);
    $expiration = (int) $expiration;
    /**
     * Filters the expiration for a site transient before its value is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 4.4.0
     *
     * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.
     * @param mixed  $value      New value of site transient.
     * @param string $transient  Transient name.
     */
    $expiration = apply_filters("expiration_of_site_transient_{$transient}", $expiration, $value, $transient);
    if (wp_using_ext_object_cache() || wp_installing()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         * @since 4.4.0 The `$transient` parameter was added
         *
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         * @param string $transient  Transient name.
         */
        do_action("set_site_transient_{$transient}", $value, $expiration, $transient);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 5.5

/**
 * Sets/updates the value of a site transient.
 *
 * You do not need to serialize values. If the value needs to be serialized,
 * then it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           167 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
 * @return bool True if the value was set, false otherwise.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filters the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     * @since 4.4.0 The `$transient` parameter was added.
     *
     * @param mixed  $value     New value of site transient.
     * @param string $transient Transient name.
     */
    $value = apply_filters("pre_set_site_transient_{$transient}", $value, $transient);
    $expiration = (int) $expiration;
    /**
     * Filters the expiration for a site transient before its value is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 4.4.0
     *
     * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.
     * @param mixed  $value      New value of site transient.
     * @param string $transient  Transient name.
     */
    $expiration = apply_filters("expiration_of_site_transient_{$transient}", $expiration, $value, $transient);
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         * @since 4.4.0 The `$transient` parameter was added
         *
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         * @param string $transient  Transient name.
         */
        do_action("set_site_transient_{$transient}", $value, $expiration, $transient);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 5.4

/**
 * Sets/updates the value of a site transient.
 *
 * You do not need to serialize values. If the value needs to be serialized,
 * then it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           167 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filters the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     * @since 4.4.0 The `$transient` parameter was added.
     *
     * @param mixed  $value     New value of site transient.
     * @param string $transient Transient name.
     */
    $value = apply_filters("pre_set_site_transient_{$transient}", $value, $transient);
    $expiration = (int) $expiration;
    /**
     * Filters the expiration for a site transient before its value is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 4.4.0
     *
     * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.
     * @param mixed  $value      New value of site transient.
     * @param string $transient  Transient name.
     */
    $expiration = apply_filters("expiration_of_site_transient_{$transient}", $expiration, $value, $transient);
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         * @since 4.4.0 The `$transient` parameter was added
         *
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         * @param string $transient  Transient name.
         */
        do_action("set_site_transient_{$transient}", $value, $expiration, $transient);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 4.8

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           167 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filters the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     * @since 4.4.0 The `$transient` parameter was added.
     *
     * @param mixed  $value     New value of site transient.
     * @param string $transient Transient name.
     */
    $value = apply_filters("pre_set_site_transient_{$transient}", $value, $transient);
    $expiration = (int) $expiration;
    /**
     * Filters the expiration for a site transient before its value is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 4.4.0
     *
     * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.
     * @param mixed  $value      New value of site transient.
     * @param string $transient  Transient name.
     */
    $expiration = apply_filters("expiration_of_site_transient_{$transient}", $expiration, $value, $transient);
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         * @since 4.4.0 The `$transient` parameter was added
         *
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         * @param string $transient  Transient name.
         */
        do_action("set_site_transient_{$transient}", $value, $expiration, $transient);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 4.7

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           40 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filters the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     * @since 4.4.0 The `$transient` parameter was added.
     *
     * @param mixed  $value     New value of site transient.
     * @param string $transient Transient name.
     */
    $value = apply_filters("pre_set_site_transient_{$transient}", $value, $transient);
    $expiration = (int) $expiration;
    /**
     * Filters the expiration for a site transient before its value is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 4.4.0
     *
     * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.
     * @param mixed  $value      New value of site transient.
     * @param string $transient  Transient name.
     */
    $expiration = apply_filters("expiration_of_site_transient_{$transient}", $expiration, $value, $transient);
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         * @since 4.4.0 The `$transient` parameter was added
         *
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         * @param string $transient  Transient name.
         */
        do_action("set_site_transient_{$transient}", $value, $expiration, $transient);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 4.6

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           40 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filters the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     * @since 4.4.0 The `$transient` parameter was added.
     *
     * @param mixed  $value     New value of site transient.
     * @param string $transient Transient name.
     */
    $value = apply_filters('pre_set_site_transient_' . $transient, $value, $transient);
    $expiration = (int) $expiration;
    /**
     * Filters the expiration for a site transient before its value is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 4.4.0
     *
     * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.
     * @param mixed  $value      New value of site transient.
     * @param string $transient  Transient name.
     */
    $expiration = apply_filters('expiration_of_site_transient_' . $transient, $expiration, $value, $transient);
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         * @since 4.4.0 The `$transient` parameter was added
         *
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         * @param string $transient  Transient name.
         */
        do_action('set_site_transient_' . $transient, $value, $expiration, $transient);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 4.4

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           40 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filter the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     * @since 4.4.0 The `$transient` parameter was added.
     *
     * @param mixed  $value     New value of site transient.
     * @param string $transient Transient name.
     */
    $value = apply_filters('pre_set_site_transient_' . $transient, $value, $transient);
    $expiration = (int) $expiration;
    /**
     * Filter the expiration for a site transient before its value is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 4.4.0
     *
     * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.
     * @param mixed  $value      New value of site transient.
     * @param string $transient  Transient name.
     */
    $expiration = apply_filters('expiration_of_site_transient_' . $transient, $expiration, $value, $transient);
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         * @since 4.4.0 The `$transient` parameter was added
         *
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         * @param string $transient  Transient name.
         */
        do_action('set_site_transient_' . $transient, $value, $expiration, $transient);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 4.1

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           40 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0.
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filter the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     *
     * @param mixed $value Value of site transient.
     */
    $value = apply_filters('pre_set_site_transient_' . $transient, $value);
    $expiration = (int) $expiration;
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         *
         * @param mixed $value      Site transient value.
         * @param int   $expiration Time until expiration in seconds. Default 0.
         */
        do_action('set_site_transient_' . $transient, $value, $expiration);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds. Default 0.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 4.0

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           40 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0.
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filter the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, $transient, refers to the transient name.
     *
     * @since 3.0.0
     *
     * @param mixed $value Value of site transient.
     */
    $value = apply_filters('pre_set_site_transient_' . $transient, $value);
    $expiration = (int) $expiration;
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, $transient, refers to the transient name.
         *
         * @since 3.0.0
         *
         * @param mixed $value      Site transient value.
         * @param int   $expiration Time until expiration in seconds. Default 0.
         */
        do_action('set_site_transient_' . $transient, $value, $expiration);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds. Default 0.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 3.9

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @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
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filter the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, $transient, refers to the transient name.
     *
     * @since 3.0.0
     *
     * @param mixed $value Value of site transient.
     */
    $value = apply_filters('pre_set_site_transient_' . $transient, $value);
    $expiration = (int) $expiration;
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, $transient, refers to the transient name.
         *
         * @since 3.0.0
         *
         * @param mixed $value      Site transient value.
         * @param int   $expiration Time until expiration in seconds. Default 0.
         */
        do_action('set_site_transient_' . $transient, $value, $expiration);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds. Default 0.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}

WordPress Version: 3.7

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @see set_transient()
 * @since 2.9.0
 * @package WordPress
 * @subpackage Transient
 *
 * @uses apply_filters() Calls 'pre_set_site_transient_$transient' hook to allow overwriting the
 * 	transient value to be stored.
 * @uses do_action() Calls 'set_site_transient_$transient' and 'setted_site_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
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    $value = apply_filters('pre_set_site_transient_' . $transient, $value);
    $expiration = (int) $expiration;
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_site_option($option)) {
            if ($expiration) {
                add_site_option($transient_timeout, time() + $expiration);
            }
            $result = add_site_option($option, $value);
        } else {
            if ($expiration) {
                update_site_option($transient_timeout, time() + $expiration);
            }
            $result = update_site_option($option, $value);
        }
    }
    if ($result) {
        do_action('set_site_transient_' . $transient, $value, $expiration);
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}