wp_cache_get_last_changed

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

WordPress Version: 6.3

/**
 * Gets last changed date for the specified cache group.
 *
 * @since 4.7.0
 *
 * @param string $group Where the cache contents are grouped.
 * @return string UNIX timestamp with microseconds representing when the group was last changed.
 */
function wp_cache_get_last_changed($group)
{
    $last_changed = wp_cache_get('last_changed', $group);
    if ($last_changed) {
        return $last_changed;
    }
    return wp_cache_set_last_changed($group);
}

WordPress Version: 5.5

/**
 * Gets last changed date for the specified cache group.
 *
 * @since 4.7.0
 *
 * @param string $group Where the cache contents are grouped.
 * @return string UNIX timestamp with microseconds representing when the group was last changed.
 */
function wp_cache_get_last_changed($group)
{
    $last_changed = wp_cache_get('last_changed', $group);
    if (!$last_changed) {
        $last_changed = microtime();
        wp_cache_set('last_changed', $last_changed, $group);
    }
    return $last_changed;
}

WordPress Version: 4.8

/**
 * Get last changed date for the specified cache group.
 *
 * @since 4.7.0
 *
 * @param string $group Where the cache contents are grouped.
 *
 * @return string $last_changed UNIX timestamp with microseconds representing when the group was last changed.
 */
function wp_cache_get_last_changed($group)
{
    $last_changed = wp_cache_get('last_changed', $group);
    if (!$last_changed) {
        $last_changed = microtime();
        wp_cache_set('last_changed', $last_changed, $group);
    }
    return $last_changed;
}

WordPress Version: 4.7

/**
 * Get last changed date for the specified cache group.
 *
 * @since 4.7.0
 *
 * @param $group Where the cache contents are grouped.
 *
 * @return string $last_changed UNIX timestamp with microseconds representing when the group was last changed.
 */
function wp_cache_get_last_changed($group)
{
    $last_changed = wp_cache_get('last_changed', $group);
    if (!$last_changed) {
        $last_changed = microtime();
        wp_cache_set('last_changed', $last_changed, $group);
    }
    return $last_changed;
}