SearchWP

This Documentation is for SearchWP Version 3

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:

<?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 );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$string String

The converted string

$original_string String

The original string