函数文档

wp_cache_set_posts_last_changed()

💡 云策文档标注

概述

wp_cache_set_posts_last_changed() 函数用于设置 'posts' 缓存组的最后更改时间,以支持缓存失效机制。它通过调用 wp_cache_set_last_changed() 实现,是 WordPress 缓存系统的一部分。

关键要点

  • 函数 wp_cache_set_posts_last_changed() 设置 'posts' 缓存组的最后更改时间。
  • 它内部调用 wp_cache_set_last_changed('posts') 来更新缓存时间戳。
  • 此函数在 WordPress 5.0.0 版本中引入,用于清理 post 缓存时触发。
  • 相关函数包括 wp_cache_set_last_changed() 和 clean_post_cache()。

📄 原文内容

Sets the last changed time for the ‘posts’ cache group.

Source

function wp_cache_set_posts_last_changed() {
	wp_cache_set_last_changed( 'posts' );
}

Changelog

Version Description
5.0.0 Introduced.