From 4e5b9acb5d456d8751f8a3036cb8d016911bb0f3 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 12 Nov 2024 20:35:23 +0000 Subject: [PATCH] Update Actions.php Convert queries to lowercase and remove trailing whitespace to ensure same terms are grouped together --- src/Actions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Actions.php b/src/Actions.php index 2ac470ad..e29b98d5 100644 --- a/src/Actions.php +++ b/src/Actions.php @@ -94,7 +94,8 @@ public function maybe_register_assets() { $data = wp_json_encode( [ 'props' => [ - 'search_query' => trim(get_search_query()), + // convert queries to lowercase and remove trailing whitespace to ensure same terms are grouped together + 'search_query' => strtolower(trim(get_search_query())), 'result_count' => $wp_query->found_posts, ], ]