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

Reply To: Integrating ASP results with BuddyBoss Search Component's Results Template

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Integrating ASP results with BuddyBoss Search Component's Results Template Reply To: Integrating ASP results with BuddyBoss Search Component's Results Template

#35132
nickchomey18nickchomey18
Participant

I dug into the code a bit more and it appears that ASP just passes the results to WP_Query’s posts variable, which is then used by the Loop. But it appears to be cleared/inaccessible by the time the BuddyBoss code is initiated based on the URL parameters mentioned above.

So, I have made a couple different modifications directly in the ASP code that allow me to access the search results elsewhere. I added a global variable to the end of wp-content\plugins\ajax-search-pro\includes\classes\search\class-asp-query.php that is equal to the returned array, $results. This can then be retrieved from within the BB search code. I also put this array in $GLOBAL[‘variable’], which seems to offer the same ability to be retrieved.

This is obviously not a sustainable solution, given that it won’t persist with updates to ASP. So, it would be ideal if I could create this global variable via a do_action hook.

In class-asp-search.php, there is a hook “do_action(‘asp_after_search’, $s, $results, $id);” but this appears to only be accessible by the live search. Or, at the very least, it is not accessible by the class-asp-searchoverride.php that is being used in this case.

So, I am hoping you could perhaps do one of two things:

1. move the ‘asp_after_search’ hook to a place (class-asp-query?) where it would be accessible to all search methods. After all, this is where ‘asp_before_search’, and 8 other after_contenttype_results hooks are located.

2. create a new hook either at the end of class-asp-query.php or within class-asp-searchoverride.php

I could then use one of these hooks to create a global variable of my own, which I could then use from my modified BuddyBoss search function.

While you are at it, it would be greatly appreciated if you could add the SQL Query filters requested in this ticket: https://wp-dreams.com/forums/topic/can-you-please-add-additional-query_add_select-from-join-where-filters/

If you have thoughts on the above or any alternative solutions for this problem, I would love to hear them.

Thanks very much!