Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › index pdf contents of custom post type › Reply To: index pdf contents of custom post type
June 28, 2019 at 7:49 am
#23475
Keymaster
Hi,
Thank you for the previous details, I will look into that plugin API, I already added it to the upcoming features list. It is a pretty decent plugin, I am sure they have an API I can use to get the downloads.
For changing the result URLs as well as image, a custom code should be used. There is this example, based on that, you could try something like this:
add_filter( 'asp_results', 'asp_custom_link_results', 1, 1 );
function asp_custom_link_results( $results ) {
// Parse through each result item
foreach ($results as $k=>&$r) {
if ( isset($r->post_type) && $r->post_type == 'attachment' ) {
// $r->id is the attachment ID, in case needed
$r->link = 'https://google.com'; // custom link
$r->image = https://'myimage.com/image.jpeg'; // custom image url
}
}
return $results;
}