diff --git a/quick-cache/includes/share.php b/quick-cache/includes/share.php index d0b9e7a..64ec91f 100644 --- a/quick-cache/includes/share.php +++ b/quick-cache/includes/share.php @@ -1789,7 +1789,7 @@ public function delete_all_files_dirs_in($dir, $delete_dir_too = FALSE) * * @since 140422 First documented version. * - * @return array Lock type & resource handle needed to unlock later. + * @return array Lock type & resource handle needed to unlock later or FALSE if disabled by filter. * * @throws \exception If {@link \sem_get()} not available and there's * no writable tmp directory for {@link \flock()} either. @@ -1801,6 +1801,9 @@ public function delete_all_files_dirs_in($dir, $delete_dir_too = FALSE) */ public function cache_lock() { + if((boolean)apply_filters('quick_cache_disable_cache_locking', FALSE)) + return false; + if(!($wp_config_file = $this->find_wp_config_file())) throw new \exception(__('Unable to find the wp-config.php file.', $this->text_domain)); @@ -1831,6 +1834,9 @@ public function cache_lock() */ public function cache_unlock(array $lock) { + if((boolean)apply_filters('quick_cache_disable_cache_locking', FALSE)) + return; + if(!is_array($lock)) return; // Not possible.