Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Misunderstanding: buddypress groupforums usage

@jyd44

Participant

My proposal is based on the hook mechanism proposed by WP and that bbPress use intensely, giving a lot of possibilities for (business) logic customisation. This is not related to the templates files in the theme, which are more related to the presentation (how the informations are displayed). Restricting the possibility to make a reply to the member of a group is a pure “business logic” requirement. You may find few explanations on how it works in the part 5 of the step by step documentation on this site.

You add the two functions in the functions.php file of your theme.
In the same file, add the following line, for instance after the two functions or at the end of the file:
add_filter (‘bbp_current_user_can_publish_replies’, my_bbp_current_user_can_publish_replies, 10);

This is the way you install filter under WP.

PS: you can replace the test: if (groups_is_user_admin( $user_id, $groups_id[0])
|| groups_is_user_mod ($user_id, $groups_id[0])
|| groups_is_user_member ($user_id, $groups_id[0]) )

by this one, which is sufficient for your purpose:
if ( groups_is_user_member ($user_id, $groups_id[0]) ) return true;

Skip to toolbar