Search phrase validation

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 5 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12421
    fespigado
    fespigado
    Participant

    Hi Ernest,

    I need to remove some characters written by the users before the search.
    and change in the search box.

    Ex: 1234 567 to 1234567 or 1234.567 to 1234567

    I can use
    Add_action (‘asp_before_search’, ‘asp_change_phrase’, 10, 1);
    str_replace…
    OR
    Add_filter (‘asp_after_search’, 10, 1);?
    str_replace…

    Thanks

    #12432
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I think this is what you are looking for: https://wp-dreams.com/knowledge-base/replace-or-remove-characters-from-search-phrase/

    That code should be the base, but change the two variables to:

    $characters = " .";
    $replace_with = "";  

    So space and dot is replaced with empty string.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #12445
    fespigado
    fespigado
    Participant

    Everytihng work good Ernest!

    One more thing,
    It’s possible to put beside the related image of each category?

    Thank you a lot.
    You have created an excellent plugin.

    Attachments:
    You must be logged in to view attached files.
    #12451
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are very welcome, and thank you for your kind words!

    Unfortunately that is not possible, I’m sorry.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.