Note: You are viewing the documentation for Version 3View Version 4 Docs

Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

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

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP