From 2f862160f82b31440e29dd643010ae345aa5909a Mon Sep 17 00:00:00 2001 From: Iain Date: Mon, 25 Feb 2019 22:05:53 +0000 Subject: [PATCH 1/2] Gitignore PhpStorm .idea dir --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8110e4f..32e56d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode +.idea /vendor/ From 5c9a458bb7dd98cbb601d9d78e0f4b2d0c1b0532 Mon Sep 17 00:00:00 2001 From: Iain Date: Mon, 25 Feb 2019 22:09:04 +0000 Subject: [PATCH 2/2] Redirect to current page on cache purge. --- src/spinupwp.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spinupwp.php b/src/spinupwp.php index 8177461..0415297 100644 --- a/src/spinupwp.php +++ b/src/spinupwp.php @@ -123,10 +123,12 @@ public function handle_manual_purge_action() { $type = 'page'; } + $redirect_url = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : admin_url(); + wp_safe_redirect( add_query_arg( array( 'purge_success' => (int) $purge, 'cache_type' => $type, - ), admin_url() ) ); + ), $redirect_url ) ); } /**