This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Ignore unlinked Attachments

#21512
AdditiveFXAdditiveFX
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.