From e84f79a6338495d0006b2922ea85d976afb085c9 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 5 Nov 2024 14:24:28 +0000 Subject: [PATCH] Trim the search query Trim the search query to stop duplicate terms in the results when someone adds a space on the end --- src/Actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Actions.php b/src/Actions.php index e7ab70e6..2ac470ad 100644 --- a/src/Actions.php +++ b/src/Actions.php @@ -94,7 +94,7 @@ public function maybe_register_assets() { $data = wp_json_encode( [ 'props' => [ - 'search_query' => get_search_query(), + 'search_query' => trim(get_search_query()), 'result_count' => $wp_query->found_posts, ], ]