Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created March 24, 2020 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/5b16c0918f8fb91956e7b2cc4afadbf0 to your computer and use it in GitHub Desktop.
Save jchristopher/5b16c0918f8fb91956e7b2cc4afadbf0 to your computer and use it in GitHub Desktop.
Always add 'coffee' to SearchWP partial matches even if it's not
<?php
// Always add 'coffee' to partial matches even if it's not.
add_filter(
'searchwp\query\partial_matches\tokens',
function( $partial_match_tokens, $args ) {
$partial_match_tokens[] = 'coffee';
return $partial_match_tokens;
},
10, 2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment