mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Suspend cache invalidation while importing posts with WP importer
git-svn-id: https://develop.svn.wordpress.org/trunk@9106 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2847,4 +2847,24 @@ function wp_guess_url() {
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Suspend cache invalidation.
|
||||
*
|
||||
* Turns cache invalidation on and off. Useful during imports where you don't wont 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.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param bool $suspend Whether to suspend or enable cache invalidation
|
||||
* @return bool The current suspend setting
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user