I'm trying to apply a filter to post_results so that I can search a WordPress application's custom fields and return matching application objects (Think products in a store, or branches in a store directory). The inidividual objects don't exist as specific posts or pages - rather there is a single page who's output is filtered to include the application output.
I've managed to get a filter function running to identify the permalinks that I need to return (E.g. /shop/product1/ or /directory/branch1) and I can identify the page ID that the application normally resides at - but I can't work out a way of passing this through to be displayed. If I add the page to the results array then just the basic page gets displayed - not the specific product. Is there a way to pass the permalink in so that the right content gets displayed - or am I going about this totally wrong??