Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Ignore unlinked Attachments › Reply To: Ignore unlinked Attachments
March 8, 2019 at 3:25 pm
#21512
Participant
Hi,
I have tried this and no luck.
I think I know why it is not working: when I return $r->content_type somewhere visible it’s always “pagepost” – never “attachment”
Is there something wrong in my settings?
add_filter('asp_results', 'asp_results_remove_unlinked_attachments');
function asp_results_remove_unlinked_attachments($results) {
foreach ($results as $k=>&$r) {
$results[$k]->title = $r->content_type;
}
return $results;
}
this always returns “pagepost” as the search item title.