Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Remove Peepso Label From user Name in Search Suggestions/Results
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 4 years, 2 months ago.
- AuthorPosts
- September 24, 2019 at 12:09 pm #24105
Hello,
Please see the attached image. I don’t want my users to know that we are using Peepso, how can i hide the label “Peepso_User_X” from the search suggestions and results?
Also, for posts related to Peepso comments is there nay way to show a thumbnail image of the original post?
Thank you for your help!
Attachments:
You must be logged in to view attached files.September 24, 2019 at 12:28 pm #24107Hi,
Looks like those are some sort of unfiltered mentions. I guess the only way to fix them is by using a custom code. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter('asp_results', 'asp_remove_peepso_mentions', 10, 1); function asp_remove_peepso_mentions($results) { foreach ( $results as $k => &$r ) { $r->title = preg_replace('/@peepso_user_[0-9]{1,5}\((.*?)\).*?/i', '$1', $r->title); $r->content = preg_replace('/@peepso_user_[0-9]{1,5}\((.*?)\).*?/i', '$1', $r->content); } }
Please be careful, I have not been able to test this code yet.
As for the images, unfortunately there is no way of getting those at them moment, I am sorry.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 24, 2019 at 5:16 pm #24112Hello Earnest,
I tried adding that code to the Functions.php file but it unfortunately broke the the search bar to where it was not able to find search results for anything. I tried searching many terms and each time it said there where no results found. When I removed the function the search bar went back to normal.
September 25, 2019 at 8:18 am #24114Hi,
Can you please try this variation then:
add_filter('asp_results', 'asp_remove_peepso_mentions', 10, 1); function asp_remove_peepso_mentions($results) { foreach ( $results as $k => &$r ) { $r->title = preg_replace('/@peepso_user_[0-9]{1,5}\((.*?)\).*?/i', '$1', $r->title); $r->content = preg_replace('/@peepso_user_[0-9]{1,5}\((.*?)\).*?/i', '$1', $r->content); } return $results; }
If it does not work, then can you please add temporary FTP access, and I will try to debug the code directly within the given file. Thank you!
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.