Re: How to enable search in bbPress plugin
Without doing some ender the hood trickery, it’s going to be hard to include all results and satisfy the majority of uses.
bbPress already does some of this to prevent things like rouge comment forms appearing where maybe they shouldn’t. I haven’t been able to come up with a working solution that I think satisfies what 80% of the people using bbPress will want, namely because the WordPress core search function makes what we want to do, a little difficult.
The other thing that you’re noticing is that all search results look like blog posts. That’s because that’s how the search.php in almost all WordPress themes is coded to look. bbPress can’t really intercept every possible query and scan the post_type for topic/reply, and then inject something different, on every singe possible page load. Well, it could, but I suspect the performance hit would be fairly costly and it probably wouldn’t scale well into millions of entries.
So, we’re kinda stuck.
In the meantime, you can append:
?ts=whatever
to search topics, and
?rs=whatever
to search replies in a specific topic, so I do have some logic built in to allow for this… but, it does need some massaging before it’s what I would consider to be ‘correct.’