函数文档

wp_cache_add_non_persistent_groups()

💡 云策文档标注

概述

wp_cache_add_non_persistent_groups() 函数用于将一个或多个组添加到非持久化组列表中,以控制缓存行为。

关键要点

  • 参数 $groups 接受字符串或字符串数组,指定要添加的组。
  • 函数在默认缓存不持久化时可能无实际作用,但用于定义非持久化组。
  • 相关函数包括 WP_Theme::__construct()、wp_start_object_cache()、switch_to_blog() 和 restore_current_blog()。
  • 自 WordPress 2.6.0 版本引入。

📄 原文内容

Adds a group or set of groups to the list of non-persistent groups.

Parameters

$groupsstring|string[]required
A group or an array of groups to add.

Source

function wp_cache_add_non_persistent_groups( $groups ) {
	// Default cache doesn't persist so nothing to do here.
}

Changelog

Version Description
2.6.0 Introduced.