Legacy workaround to skip invalidation of child posts when editing a parent.

Older WordPress versions invalidated child post caches when updating a parent, which could clear thousands of topic and reply caches during a single edit. Supported WordPress versions no longer need this workaround.

since 2.1.0 bbPress (r4011)
deprecated 2.7.0 WordPress no longer invalidates child post caches on update. Retained for compatibility; bbPress no longer instantiates it.
package bbPress
subpackage Cache

 Methods

Hook into the 'pre_post_update' action.

__construct() 
since 2.1.0 bbPress (r4011)

Only clean post caches for main bbPress posts.

pre_post_update(integer $post_id = 0

Check that the post being updated is a bbPress post type, saves the post ID to be used later, and adds an action to 'clean_post_cache' that prevents child post caches from being cleared.

since 2.1.0 bbPress (r4011)

Parameters

$post_id

integer

The post ID being updated.

Restore the cache invalidation to its previous value.

restore_cache_invalidation() 
since 2.1.0 bbPress (r4011)

 Properties

 

The original value of $_wp_suspend_cache_invalidation global.

$original_cache_invalidation : boolean

Default

false
 

Post ID being updated.

$updating_post : integer

Default

0