Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search result name details › Reply To: Search result name details
January 17, 2018 at 12:57 pm
#16339
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.