Remove Peepso Label From user Name in Search Suggestions/Results

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 Ernest Marcinko 2 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24105
    damien21
    damien21
    Participant

    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.
    #24107
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #24112
    damien21
    damien21
    Participant

    Hello 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.

    #24114
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


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

You must be logged in to reply to this topic.