/** * Constructor * Hook actions / filters * @return GD_System_Plugin_Cache_Purge */ public function __construct() { parent::__construct(); // Theme change add_action('switch_theme', array($this, 'ban_cache')); // Plugin activate/deactivate add_action('deactivated_plugin', array($this, 'ban_cache')); add_action('activated_plugin', array($this, 'ban_cache')); // Core update add_action('_core_updated_successfully', array($this, 'ban_cache')); // Plugin / theme update add_action('upgrader_process_complete', array($this, 'ban_cache')); // Permalink change add_action('update_option_permalink_structure', array($this, 'ban_cache')); // Update posts add_action('publish_post', array($this, 'purge_cache')); add_action('edit_post', array($this, 'purge_cache')); add_action('deleted_post', array($this, 'purge_cache')); add_action('clean_post_cache', array($this, 'purge_cache')); // Update comments add_action('comment_post', array($this, 'purge_comment')); add_action('wp_set_comment_status', array($this, 'purge_comment')); add_action('edit_comment', array($this, 'purge_comment')); // Theme customizer add_action('customize_save', array($this, 'ban_cache')); // Changed widgets add_action('update_option_sidebars_widgets', array($this, 'ban_cache')); }
/** * Constructor * * @since 0.1.1 * @param object $plugin Main plugin object. * @return void */ public function __construct($plugin) { $this->plugin = $plugin; parent::__construct(); }