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 ) ); } /**