Skip to:
Content
Pages
Categories
Search
Top
Bottom

Group Forum with bbp private groups

  • @bbbt

    Participant

    Hi,

    We use bbpress, buddypress, and bbp-private-groups in a WordPress installation.
    Thank you for the great plugins!

    In the Buddypress Group Settings, the group administrator can also create a forum.
    How can I add a specific group from bbp-private-groups to a group forum when creating the group forum?
    I couldn’t find an option for this in the backend settings.
    Is there a suitable hook? I don’t know the forum ID yet for “groups_group_after_save”.
    I would add the group with add_post_meta( $forum_id, ‘_private_group’, ‘group1’, false );.

    Thanks for any tips!
    bbbt

Viewing 2 replies - 1 through 2 (of 2 total)
  • @robin-w

    Moderator

    I’m pretty sure that the buddypress function hooks to the new_forum_handler in bbpress, so this should work

    add_action( 'bbp_new_forum_post_extras', 'rew_add_pg', 10 , 1) ;
    
    function rew_add_pg ($forum_id ) {
    	 add_post_meta( $forum_id, '_private_group', 'group1', false );
    }

    Let me know of not.

    @bbbt

    Participant

    Thank you for your prompt response.
    The hook bbp_new_forum_post_extras is not being called.

    I have now tried the hook bbp_insert_forum. It is being called. To ensure that it is a group forum, I then ran the following query:
    $group_ids = get_post_meta( $forum_id, ‘_bbp_group_ids’, false );

    $group_ids does not yet exist at this point. I only want to call add_post_meta( $forum_id, ‘_private_group’, ‘group1’, false ); if it is a group forum.

    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar