Reply To: Help

#3062

Ernest Marcinko
Keymaster

Hi Adam!

The plugin uses an entirely different method to parse results than the built in queries. I do not recommend modifying the code, as you will loose the changes if you upgrade the plugin.

There are however filters and actions available, that you can use to customize the results or add/remove new ones.

Here is a knowledgebase article about adding category titles to the result titles: https://wp-dreams.com/knowledge-base/showing-the-category-titles-in-the-result-title/
It's a good starting point to understand how the results structure looks like.

Based on the example above you can replace the 'asp_add_category_titles' function body with something like:

function asp_add_category_titles( $pageposts ) {
  var_dump($pageposts);
  return $pageposts;
} 

..and then examining the xhr/ajax request you will see the structure of the $pageposts variable, which is an array of objects, where the objects are the results.

Another example: https://wp-dreams.com/knowledge-base/showing-the-post-type-name-in-post-title/

The full action and filter list is available in the plugins main directory in the actions.txt and filters.txt files.

So using this filter you can do whatever you want with the result list. It requires a bit PHP knowledge though.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)