From d0a6fb9db6fdc4b5e72215de284e32ca19c957bd Mon Sep 17 00:00:00 2001 From: Chris Davies Date: Mon, 4 Mar 2013 09:27:02 -0500 Subject: [PATCH] purge actions --- README.markdown | 10 +++++++++- readme.txt | 10 +++++++++- wp-varnish.php | 11 ++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README.markdown b/README.markdown index a496ab6..163c94b 100644 --- a/README.markdown +++ b/README.markdown @@ -6,7 +6,7 @@ WordPress Varnish * Tags: cache, caching, performance, varnish, purge, speed * Requires at least: 2.9.2 * Tested up to: 3.5.1 -* Stable tag: 0.6 +* Stable tag: 0.7 WordPress Varnish is a simple plugin that purges new and edited content. @@ -78,6 +78,10 @@ Screenshots Changelog --------- +### 0.7 +* Added purge when post changes from future to publish, Thanks Marcin Pietrzak +* Added purge when theme switched, Thanks dupuis + ### 0.6 * Removed plugins_loaded action as it doesnt do what was expected re: Issue #12. Thank you Ben Favre, Pothi Kalimuthu and allinwonder @@ -112,6 +116,10 @@ Changelog Upgrade Notice -------------- +### 0.7 +* Added purge when post changes from future to publish, Thanks Marcin Pietrzak +* Added purge when theme switched, Thanks dupuis + ### 0.6 * Removed plugins_loaded action as it doesnt do what was expected re: Issue #12. Thank you Ben Favre, Pothi Kalimuthu and allinwonder diff --git a/readme.txt b/readme.txt index 39d5b4e..720006e 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: http://github.com/pkhamre/wp-varnish Tags: cache, caching, performance, varnish, purge, speed Requires at least: 2.9.2 * Tested up to: 3.5.1 -* Stable tag: 0.6 +* Stable tag: 0.7 WordPress Varnish is a simple plugin that purges new and edited content. @@ -71,6 +71,10 @@ surfer's IP rather than the server's IP. == Changelog == += 0.7 = +* Added purge when post changes from future to publish, Thanks Marcin Pietrzak +* Added purge when theme switched, Thanks dupuis + = 0.6 = * Removed plugins_loaded action as it doesnt do what was expected re: Issue #12. Thank you Ben Favre, Pothi Kalimuthu and allinwonder @@ -101,6 +105,10 @@ surfer's IP rather than the server's IP. == Upgrade Notice == += 0.7 = +* Added purge when post changes from future to publish, Thanks Marcin Pietrzak +* Added purge when theme switched, Thanks dupuis + = 0.6 = * Removed plugins_loaded action as it doesnt do what was expected re: Issue #12. Thank you Ben Favre, Pothi Kalimuthu and allinwonder diff --git a/wp-varnish.php b/wp-varnish.php index d3777d9..d844f49 100644 --- a/wp-varnish.php +++ b/wp-varnish.php @@ -2,7 +2,7 @@ /* Plugin Name: WordPress Varnish Plugin URI: http://github.com/pkhamre/wp-varnish -Version: 0.6 +Version: 0.7 Author: Pål-Kristian Hamre Description: A plugin for purging Varnish cache when content is published or edited. @@ -110,6 +110,15 @@ function WPVarnish() { // When xmlRPC call is made add_action('xmlrpc_call',array($this, 'WPVarnishPurgeAll'), 99); + // When a post changes from future to publish, Thanks Marcin Pietrzak + add_action('future_to_publish', array($this, + 'WPVarnishPurgePost'), 99); + add_action('future_to_publish', array($this, + 'WPVarnishPurgePurgeCommonObjects'), 99); + + // When Theme is changed, Thanks dupuis + add_action('switch_theme',array($this, 'WPVarnishPurgeAll'), 99); + // When a new plugin is loaded // this was added due to Issue #12, but, doesn't do what was intended // commenting this out gets rid of the incessant purging.