Advertisement
swte

Remove auto clear cache hooks

Feb 14th, 2022
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.90 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Plugin Name: Swift Performance Tweaks
  5.  */
  6.  
  7. add_action('swift_performance_cache_init', function(){
  8.     remove_action('save_post', array('Swift_Performance_Cache', 'clear_post_cache'));
  9.     remove_action('delete_post', array('Swift_Performance_Cache', 'clear_post_cache'));
  10.     remove_action('wp_trash_post', array('Swift_Performance_Cache', 'clear_post_cache'));
  11.     remove_action('pre_post_update', array('Swift_Performance_Cache', 'clear_post_cache'));
  12.     remove_action('delete_attachment', array('Swift_Performance_Cache', 'clear_post_cache'));
  13.     remove_action('woocommerce_product_object_updated_props', array('Swift_Performance_Cache', 'clear_post_cache'));
  14.     remove_action('woocommerce_product_set_stock', array('Swift_Performance_Cache', 'clear_post_cache'));
  15.     remove_action('woocommerce_variation_set_stock', array('Swift_Performance_Cache', 'clear_post_cache'));
  16.     remove_action('fl_builder_after_save_layout', array('Swift_Performance_Cache', 'clear_post_cache'));
  17.  
  18.     // Clear pagecache after publish/update post
  19.     remove_action('save_post', array('Swift_Performance_Cache', 'clear_cache_after_post'));
  20.     remove_action('delete_post', array('Swift_Performance_Cache', 'clear_cache_after_post'));
  21.     remove_action('wp_trash_post', array('Swift_Performance_Cache', 'clear_cache_after_post'));
  22.     remove_action('delete_attachment', array('Swift_Performance_Cache', 'clear_cache_after_post'));
  23.     remove_action('woocommerce_product_object_updated_props', array('Swift_Performance_Cache', 'clear_cache_after_post'));
  24.     remove_action('woocommerce_product_set_stock', array('Swift_Performance_Cache', 'clear_cache_after_post'));
  25.     remove_action('woocommerce_variation_set_stock', array('Swift_Performance_Cache', 'clear_cache_after_post'));
  26.     remove_action('fl_builder_after_save_layout', array('Swift_Performance_Cache', 'clear_cache_after_post'));
  27.     remove_action('init', array('Swift_Performance_Cache', 'clear_on_user_action'));
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement