Skip to content

Conversation

@pau1phi11ips
Copy link
Contributor

Trim the search query to stop duplicate terms in the results when someone adds a space on the end

Trim the search query to stop duplicate terms in the results when someone adds a space on the end
@pau1phi11ips
Copy link
Contributor Author

I've actually just added this to functions.php file for the same fix.

add_filter('request', function ($query_vars) {
  if (!is_admin() && !empty($query_vars['s'])) {
      $query_vars['s'] = trim($query_vars['s']);
  }

  return $query_vars;
});

@Dan0sz Dan0sz merged commit deed8ae into plausible:develop Nov 6, 2024
4 checks passed
@pau1phi11ips
Copy link
Contributor Author

@Dan0sz it might be better add strtolower too?
image

@Dan0sz
Copy link
Collaborator

Dan0sz commented Nov 11, 2024

@metmarkosaric what do you think? Convert all search queries to lowercase?

@metmarkosaric
Copy link
Collaborator

@Dan0sz i think it's a good idea!

@Dan0sz
Copy link
Collaborator

Dan0sz commented Nov 12, 2024

@pau1phi11ips Go ahead with that PR then 😁

@pau1phi11ips
Copy link
Contributor Author

Done #230. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants