Modifying a BB_query on the fly?
-
Hey all,
I’m trying to intercept certain (pre-defined bbPress) queries and filter a few results out. I figured I’ll need to register an action on ‘bb_query’, but I can’t seem to modify the actual query.
Say I want to filter all topics by myself from the recent posts view, I registered the following:
add_action('bb_query', 'filter_query');
And then the code:
function filter_query(&$obj) {
if($obj->type == 'topic' && $obj->query_id == 'get_recent_posts') {
//ADD "AND topic_author != 'Litso'" to the query here
}
}Can anyone point me in the right direction?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.