• Resolved Kash

    (@jdwel)


    Hello,
    I love this plugin its super!
    I want to fix something in Arabic we have a letter Alif ‘?’ that has three different other relative characters.
    How can I do something like terms.replace(/?|?|?/g, '?') to unify the search and makes it easier for people.
    Does the plugin provide an area for this, or I should edit the code directly?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    No need to edit Relevanssi code. There’s a filter hook for that:

    add_filter( 'relevanssi_punctuation_filter', 'rlv_character_equivalency' );
    function rlv_character_equivalency( $array ) {
        $array['a1'] = 'a';
        $array['a2'] = 'a';
        $array['a3'] = 'a';
        return $array;
    }

    Just replace a1, a2, and a3 with the related characters and a with the target character and rebuild the index.

    Thread Starter Kash

    (@jdwel)

    Super!! Thank you, it worked ????

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘replace certain character’ is closed to new replies.