wp_suspend_cache_invalidation( bool $suspend = true )

Suspend cache invalidation.


Description Description

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.


Top ↑

Parameters Parameters

$suspend

(bool) (Optional) Whether to suspend or enable cache invalidation.

Default value: true


Top ↑

Return Return

(bool) The current suspend setting.


Top ↑

Source Source

File: wp-includes/functions.php

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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.