Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 15, 2022 15:05
Show Gist options
  • Save searchwpgists/34bdd40a7b6e5e28f59b1b686dece4fc to your computer and use it in GitHub Desktop.
Save searchwpgists/34bdd40a7b6e5e28f59b1b686dece4fc 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