From 09de8507b940b903c1c69b64889e65c8ff6ae42f Mon Sep 17 00:00:00 2001 From: janvitos <10037804+janvitos@users.noreply.github.com> Date: Mon, 12 Jun 2023 19:46:37 -0400 Subject: [PATCH] Update class-nginx-helper-admin.php Add an action that fires after the current URL has been purged. There is already an action that fires after all URLs have been purged, but there isn't one for when the current page has been purged. This new action is useful when using a caching plugin such as Cloudflare to purge the current URL on Cloudflare as well. --- admin/class-nginx-helper-admin.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/admin/class-nginx-helper-admin.php b/admin/class-nginx-helper-admin.php index a024e31..fa1aa72 100644 --- a/admin/class-nginx-helper-admin.php +++ b/admin/class-nginx-helper-admin.php @@ -740,6 +740,16 @@ public function purge_all() { */ do_action( 'rt_nginx_helper_after_purge_all' ); + } else { + if ( 'purge_current_page' === $action ) { + + /** + * Fire an action after the current page has been purged whatever caching type is used. + * + * @since 2.2.4 + */ + do_action( 'rt_nginx_helper_after_purge_url' ); + } } wp_redirect( esc_url_raw( $redirect_url ) );