Ticket #15812: 15812.suspend-caching.diff
File 15812.suspend-caching.diff, 1.8 KB (added by , 13 years ago) |
---|
-
wp-includes/functions.php
3531 3531 } 3532 3532 3533 3533 /** 3534 * Suspend object caching. 3535 * 3536 * Stops wp_cache_add from adding objects to the cache. Useful for imports when the huge 3537 * amount of data being added to cache isn't useful. Remember to call this again if you 3538 * want suspension to only be temporary. 3539 * 3540 * @since 3.1.0 3541 * 3542 * @param bool $suspend Whether to suspend or enable caching 3543 * @return bool The previous suspend setting 3544 */ 3545 function wp_suspend_caching( $suspend = true ) { 3546 global $_wp_suspend_caching; 3547 3548 $prev = $_wp_suspend_caching; 3549 $_wp_suspend_caching = $suspend; 3550 return $prev; 3551 } 3552 3553 /** 3534 3554 * Suspend cache invalidation. 3535 3555 * 3536 3556 * Turns cache invalidation on and off. Useful during imports where you don't wont to do invalidations … … 3540 3560 * @since 2.7.0 3541 3561 * 3542 3562 * @param bool $suspend Whether to suspend or enable cache invalidation 3543 * @return bool The currentsuspend setting3563 * @return bool The previous suspend setting 3544 3564 */ 3545 function wp_suspend_cache_invalidation( $suspend = true) {3565 function wp_suspend_cache_invalidation( $suspend = true ) { 3546 3566 global $_wp_suspend_cache_invalidation; 3547 3567 3548 3568 $current_suspend = $_wp_suspend_cache_invalidation; -
wp-includes/cache.php
22 22 * @return unknown 23 23 */ 24 24 function wp_cache_add($key, $data, $flag = '', $expire = 0) { 25 global $wp_object_cache; 25 global $wp_object_cache, $_wp_suspend_caching; 26 27 if ( ! empty( $_wp_suspend_caching ) ) 28 return false; 26 29 27 30 return $wp_object_cache->add($key, $data, $flag, $expire); 28 31 }