wppaste
WordPress

wp_suspend_cache_addition( bool $suspend = null ): bool

Since
3.3.0
Source
wp-includes/functions.php:6356
Temporarily suspends cache additions.

Description

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.

Parameters

$suspendbooloptional
Suspends additions if true, re-enables them if false. Defaults to not changing the current setting.Default: null

Return

bool
The current suspend setting.

Used by · 3

Source

function wp_suspend_cache_addition( $suspend = null ) {	static $_suspend = false; 	if ( is_bool( $suspend ) ) {		$_suspend = $suspend;	} 	return $_suspend;}

History

Introduced in 3.3.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.