Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search for quoted phrase on mobile › Reply To: Search for quoted phrase on mobile
Oh I see the issue there. It’s because the quotation marks are the curly double version. It’s super rare, but I suspect that specific keyboard layout is using that instead of the non-curly version.
Luckily this can be resolved very easily with a code snippet, so that it’s replaced to the non-curly version during processing.
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
/**
* Replace all different curly double quotation marks with the unified '"' double quote
*/
add_filter(
'asp_query_args',
function ( $args ) {
$characters = '“”';
$replace_with = '"';
$args['s'] = str_replace(str_split($characters), $replace_with, $args['s']);
return $args;
}
);
It is intentionally not replace in the plugin code, as we had a couple of requests a few years back, where people needed to be able to search these quotation marks within text, so the standard non-curly version is used for the exact matching purpose. The code snippet above should resolve that.