wp_cache_set_last_changed( string $group ): string

In this article

Sets last changed date for the specified cache group to now.

Parameters

$groupstringrequired
Where the cache contents are grouped.

Return

string UNIX timestamp when the group was last changed.

Source

	$id = ++$id_counters[ $prefix ];

	return $prefix . (string) $id;
}

/**
 * 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 );
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.