Created
January 11, 2021 16:32
-
-
Save jchristopher/b53f4235487505ef6732d985520dea6f to your computer and use it in GitHub Desktop.
Prevent SearchWP from considering repeated terms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Prevent SearchWP from considering repeated terms. | |
add_filter( 'searchwp\tokens\string', function( $string ) { | |
return implode( ' ', array_unique( explode( ' ', strtolower( $string ) ) ) ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment