From c45d8c8405932f8cae41883f0b99f69e9b023132 Mon Sep 17 00:00:00 2001 From: Julien-prrs Date: Thu, 13 Feb 2020 23:36:39 +0100 Subject: [PATCH 1/2] Add hook to fire purge_all for any caching type --- admin/class-nginx-helper-admin.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/admin/class-nginx-helper-admin.php b/admin/class-nginx-helper-admin.php index af1f6cb9..be95d9ef 100644 --- a/admin/class-nginx-helper-admin.php +++ b/admin/class-nginx-helper-admin.php @@ -717,6 +717,13 @@ public function purge_all() { break; } + /** + * Fire an action after the cache has been purged whatever caching type is used' + * + * @since 2.2.2 + */ + if ( 'purge' === $action ) do_action( 'rt_nginx_helper_after_purge_all' ); + wp_redirect( esc_url_raw( $redirect_url ) ); exit(); From c4ba9686007f2534c4a84cd9c6514de1e130d4de Mon Sep 17 00:00:00 2001 From: Julien <39372814+Julien-prrs@users.noreply.github.com> Date: Thu, 20 Feb 2020 22:32:47 +0100 Subject: [PATCH 2/2] Updated to match with feedback --- admin/class-nginx-helper-admin.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/admin/class-nginx-helper-admin.php b/admin/class-nginx-helper-admin.php index be95d9ef..f2487499 100644 --- a/admin/class-nginx-helper-admin.php +++ b/admin/class-nginx-helper-admin.php @@ -717,12 +717,16 @@ public function purge_all() { break; } - /** - * Fire an action after the cache has been purged whatever caching type is used' - * - * @since 2.2.2 - */ - if ( 'purge' === $action ) do_action( 'rt_nginx_helper_after_purge_all' ); + if ( 'purge' === $action ) { + + /** + * Fire an action after the entire cache has been purged whatever caching type is used. + * + * @since 2.2.2 + */ + do_action( 'rt_nginx_helper_after_purge_all' ); + + } wp_redirect( esc_url_raw( $redirect_url ) ); exit();