函数文档

clean_category_cache()

💡 云策文档标注

概述

clean_category_cache() 是一个 WordPress 函数,用于基于分类 ID 移除分类缓存数据。它通过调用 clean_term_cache() 实现,专门针对 'category' 分类法。

关键要点

  • 函数功能:移除指定分类 ID 的缓存数据,以提高性能或处理分类更新。
  • 参数:接受一个必需的整数参数 $id,表示分类 ID。
  • 实现方式:内部调用 clean_term_cache($id, 'category'),专注于 'category' 分类法。
  • 相关函数:与 clean_term_cache() 关联,后者用于移除所有分类法术语的缓存。
  • 版本历史:自 WordPress 2.1.0 版本引入。

📄 原文内容

Removes the category cache data based on ID.

Parameters

$idintrequired
Category ID

Source

function clean_category_cache( $id ) {
	clean_term_cache( $id, 'category' );
}

Changelog

Version Description
2.1.0 Introduced.