Hello,
I wrote this snippet to get the job done.
function exclude_private_forums_search() {
$forum_id = bbp_get_forum_id();
if (get_post_status($forum_id) == 'private') {
add_post_meta($forum_id, 'acs_exclude', 1, true );
} else {
delete_post_meta($forum_id, 'acs_exclude');
}
}
add_action('bbp_new_forum', 'exclude_private_forums_search' );
add_action('bbp_edit_forum', 'exclude_private_forums_search' );
Now the only thing I can’t seem to figure out is exclude the topics that are inside a private forum. Is there anyway to get topic IDs based off of forum id?
Might be a better question for bbpress.org, I always start in plugin sub forum though.
@lando1982 I am by no means a bbPress expert either. I’m learning as we go here. Your support has been great, a nice learning experience for me.
I hope others also will benefit from the code I wrote out here along with the action hooks provided.
Thanks.