I like to add condtions to the bp_forum_topics () loop, which contains only posts with specific keywords. Can anyone help me with this?
I'd love to create a custom plugin that overrides the current bp_forum_topics () function that does this. Im new to Wordpress development so unsure about filters and tags. Now it returns all topics (with the exception of free search queries, the latest, popular, etc.). I want to be able to return topics if posts related to these topics contain specific search terms.
I can control the encoding for this, but what I'm not sure about will override the bp_forums_get_post functions, while preserving all the other functions used in buddypress, for example get_avatar.
Any help would be great.
Mark
UPDATE: here is SQL
SELECT
post.post_id,
post.topic_id,
topic.topic_title,
post.post_text
FROM bb_posts post
LEFT JOIN bb_topics topic
ON topic.topic_id = post.topic_id
WHERE topic_title LIKE '%searchterms%' OR post_text LIKE '%searchterms%';
source
share