Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Can you please add additional query_add_select/join/where filters? › Reply To: Can you please add additional query_add_select/join/where filters?
Very slick! That’s much easier than using numerous hooks, functions etc… I’m sure that I can figure out what I need from this. Thanks very much!
Having said that, I might not even use this method anymore. Given that ASP only uses the Index Table for posts in wp_posts, ASP’s BuddyPress search is effectively the same as BuddyBoss’: wpdb->get_results. They have a tremendous amount of redundancy in their code (Query Monitor tells me that they have something like 100 duplicate queries…), but it is all set up to do the filtering for friend, group and post privacy; media such as documents, photos and videos; and also has the results formatted for their HTML generation.
So, at least for now, I’ll probably just use ASP for Index Table post types, pass the results to BB through creating a global variable with the ‘asp_results’ filter, format those results as needed for BB, and then perform the other searches with BB’s search. I’ll have to do some modifications for bbpress Topic and Reply results, which are in the Index Table, but it will be far less than re-creating all of the other stuff.
But perhaps later (both out of curiosity and to streamline everything) I will use the asp_query_args that you’ve provided to move everything over to ASP
Thanks again for your help. Hopefully you’ll soon be able to document these args for the sake of others.
P.s. Again, if you’re curious about integrating more of the BuddyBoss stuff (respect privacy, documents etc…) into ASP, the code is all open-source here: https://github.com/buddyboss/buddyboss-platform/tree/release/src/bp-search.
And, for example, here is the BuddyPress activities code, and if you look at lines 69-118, 139-142, you’ll see the code for filtering for group, friend, and post privacy. On closer inspection, it is not particularly complicated. It could (and should) be made into a function in the main class so that it isn’t called so many times. https://github.com/buddyboss/buddyboss-platform/blob/release/src/bp-search/classes/class-bp-search-activities.php
Anyway, I am quite confident that many BuddyBoss users would buy ASP if this was integrated, to say nothing of BuddyPress users who don’t have any search functionality. Because, as it stands, the ASP BuddyPress search is not particularly useful without being able to adequately respect privacy.