Specifically in the buddypress forums loop.
I want to be able to alter the SQL so that it returns only specific forums topics. I want to be able to find where the SQL is executed for a specific loop. I might stumble upon on it, but wonder if there is a good way to trace back / debug any and all loops to find the SQL that is generated.
I'm still struggling to understand loops and tags, actions and hooks. So any tips for debugging would be really helpful.
UPDATE: I tell you what I want to do exactly. I want to be able to return forum topics in buddypress forums that meet certain conditions ie I want to return certain forum topics that contain search terms in that topics posts. What is the best way to add those conditions to the forums loop sql.