Available since: 2.6
searchwp_lenient_accent_result
View Parameters »Using searchwp_lenient_accents
you can tell SearchWP to not apply exact-match logic to words containing accented characters. If SearchWP’s implementation of converting accented terms to their non-accented counterpart is not performing correctly, you can use this hook to override SearchWP’s replacement and provide your own.
Example: To override SearchWP’s accent removal, add something like the following to your theme’s functions.php:
This file contains 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 | |
function my_searchwp_leinent_accent_result( $string, $original_string ) { | |
if ( 'mytést' == $original_string ) { | |
$string = 'mytest'; | |
} | |
return $string; | |
} | |
add_filter( 'searchwp_leinent_accent_result', 'my_searchwp_leinent_accent_result', 10, 2 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$string |
String |
The converted string |
$original_string |
String |
The original string |