Reply To: Search result name details

#16339
synergy
synergy
Participant

Hi Ernest,

My website WordPress has updated to 4.9.2 and I placed this script in the updated functions.php from line 2 onwards (see below) and it is now not working.

1.<?php
2./**
3.*Filter to remove ‘Supplier’ from Ajax Pro Search results display images
4.*/
5.add_filter(‘asp_results’, ‘asp_replace_supplier_name’, 10, 4);
6.function asp_replace_supplier_name($results, $sid, $is_ajax, $args) {
7.foreach ($results as $k=>&$r) {
8.$r->title = str_replace(‘supplier-‘, ”, $r->title);
9.}
10. return $results;
11.}
12./**
13. * Main WordPress API
14. *
15. * @package WordPress
16. */

Thanks in advance.