wp_cache_set_last_changed

函数
wp_cache_set_last_changed ( $group )
参数
  • (string) $group Where the cache contents are grouped.
    Required:
返回值
  • (string) UNIX timestamp when the group was last changed.
定义位置
相关方法
wp_cache_get_last_changedwp_cache_set_users_last_changedwp_cache_set_terms_last_changedwp_cache_set_sites_last_changedwp_cache_set_posts_last_changed
引入
6.3.0
弃用
-

将指定缓存组的上次更改日期设置为现在。

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;
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 19:32:59

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: