Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search phrase validation
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 6 years, 8 months ago.
- AuthorPosts
- March 23, 2017 at 8:45 am #12421
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
March 23, 2017 at 2:26 pm #12432Hi!
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 :)
March 23, 2017 at 5:59 pm #12445Everytihng 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.March 24, 2017 at 10:32 am #12451You 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 :)
- AuthorPosts
You must be logged in to reply to this topic.