Adds cache purge on post update

Triggers cache purge when post moves from publish to publish.
Updates plugin info to reflect the cache purge on updates.
This commit is contained in:
lsemenenko 2025-08-17 00:58:13 -05:00
parent 2020b1cff0
commit a1ab59c34d
No known key found for this signature in database

View File

@ -57,6 +57,7 @@ class Cloudflare_Cache_Purger {
*/ */
private function register_hooks() { private function register_hooks() {
// Hooks specified in requirements. // Hooks specified in requirements.
add_action( 'publish_to_publish', array( $this, 'purge_cache' ) );
add_action( 'pending_to_publish', array( $this, 'purge_cache' ) ); add_action( 'pending_to_publish', array( $this, 'purge_cache' ) );
add_action( 'publish_to_trash', array( $this, 'purge_cache' ) ); add_action( 'publish_to_trash', array( $this, 'purge_cache' ) );
add_action( 'future_to_publish', array( $this, 'purge_cache' ) ); add_action( 'future_to_publish', array( $this, 'purge_cache' ) );
@ -271,6 +272,7 @@ class Cloudflare_Cache_Purger {
<p>This plugin automatically purges the Cloudflare cache when any of these WordPress events occur:</p> <p>This plugin automatically purges the Cloudflare cache when any of these WordPress events occur:</p>
<ul style="list-style-type: disc; margin-left: 20px;"> <ul style="list-style-type: disc; margin-left: 20px;">
<li>When a post is edited</li> <li>When a post is edited</li>
<li>When a post is updated</li>
<li>When a post is saved</li> <li>When a post is saved</li>
<li>When a post is deleted</li> <li>When a post is deleted</li>
<li>When an attachment is deleted</li> <li>When an attachment is deleted</li>