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



wp_suspend_cache_addition › WordPress Function

Since3.3.0
已弃用n/a
wp_suspend_cache_addition ( $suspend = null )
参数:
  • (bool) $suspend Optional. Suspends additions if true, re-enables them if false. Defaults to not changing the current setting.
    Required: No
    默认: null
返回:
  • (bool) The current suspend setting.
定义在:
文档:

Temporarily suspends cache additions.

Stops more data being added to the cache, but still allows cache retrieval. This is useful for actions, such as imports, when a lot of data would otherwise be almost uselessly added to the cache. Suspension lasts for a single page load at most. Remember to call this function again if you wish to re-enable cache adds earlier.


源码

function wp_suspend_cache_addition( $suspend = null ) {
	static $_suspend = false;

	if ( is_bool( $suspend ) ) {
		$_suspend = $suspend;
	}

	return $_suspend;
}