I’ve spent a good amount of time looking for Q&A systems over the past week and this one, by far, is the most robust and closest to meeting my client’s needs. The one thing that it doesn’t quite do out of the box is integrate into the BuddyPress groups.
Background: My client wants to be able to create a set of “Projects” which then have a set of “Issues” that can be listed and discussed within that project. I can do that with bbPress by creating a forum for each group, but a simple forum isn’t quite what we need. It’s questions, answers, and all the features you have. So, my plan is to set it up so that each BuddyPress Group is the “Project” and then (hopefully) use AnsPress in place of the bbPress forums.
My question revolves around whether my solution below is the most efficient way to go about it, or if someone on the dev team might have a more efficient or better way to tackle it.
My Solution: It seems like I can probably just disable the “Tags” for the front end of AnsPress (i.e. Users can’t add their own tags) and then I add some sort of hook in the groups so that when you ask a question from that group, it automatically inserts the group slug as a tag for that question. Then I create a function that will list questions by tag and insert that on the group page – thus showing only the questions which contain the current group slug. This will also allow browsing on the normal questions page and I should be able to edit the theme to also link to the group that the question belongs to by generating a link using the slug in the tag field.
My Question: Does this seem like an efficient way to execute this plan? Or might there be some other hooks or functions in the code that might make this better done in a different way? Please don’t spend a ton of time on this – I know your time is valuable. I’m mainly just looking for a simple, “Yeah, sounds like that is a good way to go,” or a “Have a look at function and see if that helps make it easier,” type thing.
Thanks in advance for any help/advice.
Your solution seem good to me. But if groups are CPT then AnsPress is ready for it. You just have to add group id as post_parent for AnsPress question. Later you can fetch questions using:
ap_get_questions( [ 'post_parent' => group_id ] );