Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add Subscribe button to group home page

  • @lumpysimon

    Participant

    I’ve got BuddyPress set up so that each group has one bbPress forum. I’d like to show a ‘Subscribe’ button in the group header on the group’s homepage which works exactly the same as the Subscribe button on the group’s forum page.

    I’m using the code below to show the button, but it reloads the page instead of doing an AJAX call, and it doesn’t subscribe/unsubscribe the user from the group’s forum.

    What do I need to do to get this working? The correct forum ID is being passed in the arguments.

    
    $forum_ids = bbp_get_group_forum_ids();
    if ( $forum_ids ) {
    	$sub_link_args = [ 'object_id' => reset( $forum_ids ) ];
    	bbp_forum_subscription_link( $sub_link_args );
    }
    
  • You must be logged in to reply to this topic.
Skip to toolbar