Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › "Thin" Appears in Some Search Results › Reply To: "Thin" Appears in Some Search Results
March 7, 2022 at 10:27 am
#37072
Keymaster
I think I made a mistake there, sorry about that, try this one, this will work:
add_filter( 'asp_results', 'aspl_remove_thin', 10, 1 );
add_filter( 'asl_results', 'aspl_remove_thin', 10, 1 );
function aspl_remove_thin( $results ) {
$prefix = 'thin';
foreach ($results as $k=>&$r) {
if (substr($r->content, 0, strlen($prefix)) == $prefix) {
$r->content = trim( substr($r->content, strlen($prefix)) );
}
}
return $results;
}