wp_cache_set_last_changed()WP 6.3.0

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

Хуки из функции

Возвращает

Строку. UNIX timestamp when the group was last changed.

Использование

wp_cache_set_last_changed( $group );
$group(строка) (обязательный)
Where the cache contents are grouped.

Список изменений

С версии 6.3.0 Введена.

Код wp_cache_set_last_changed() WP 6.6.2

function wp_cache_set_last_changed( $group ) {
	$previous_time = wp_cache_get( 'last_changed', $group );

	$time = microtime();

	wp_cache_set( 'last_changed', $time, $group );

	/**
	 * Fires after a cache group `last_changed` time is updated.
	 * This may occur multiple times per page load and registered
	 * actions must be performant.
	 *
	 * @since 6.3.0
	 *
	 * @param string    $group         The cache group name.
	 * @param int       $time          The new last changed time.
	 * @param int|false $previous_time The previous last changed time. False if not previously set.
	 */
	do_action( 'wp_cache_set_last_changed', $group, $time, $previous_time );

	return $time;
}