wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_suspend_cache_invalidation › WordPress Function

Since2.7.0
已弃用n/a
wp_suspend_cache_invalidation ( $suspend = true )
参数:
  • (bool) $suspend Optional. Whether to suspend or enable cache invalidation. Default true.
    Required: No
    默认: true
返回:
  • (bool) The current suspend setting.
定义在:
文档:

Suspends cache invalidation.

Turns cache invalidation on and off. Useful during imports where you don't want to do invalidations every time a post is inserted. Callers must be sure that what they are doing won't lead to an inconsistent cache when invalidation is suspended.


源码

function wp_suspend_cache_invalidation( $suspend = true ) {
	global $_wp_suspend_cache_invalidation;

	$current_suspend                = $_wp_suspend_cache_invalidation;
	$_wp_suspend_cache_invalidation = $suspend;
	return $current_suspend;
}