BuddyPress: Adding a new tab in groups

bp_core_new_subnav_item( array(
   'name' => 'My Group Page',
   'slug' => 'my-group-page',
   'parent_url' => $bp->loggedin_user->domain . $bp->groups->slug . '/',
   'parent_slug' => $bp->groups->slug,
   'screen_function' => 'my_groups_page_function_to_show_screen',
   'position' => 40 ) );

And the screen function to render the page:

function my_groups_page_function_to_show_screen() {

    //add title and content here - last is to call the members plugin.php template
    add_action( 'bp_template_title', 'my_groups_page_function_to_show_screen_title' );
    add_action( 'bp_template_content', 'my_groups_page_function_to_show_screen_content' );
    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}

    function my_groups_page_function_to_show_screen_title() {
        echo 'My Page Title';
    }
    function my_groups_page_function_to_show_screen_content() { 

        // page content goes here

    }
mkmcst
Author: mkmcst

Hey there, amazing viewers! 👋✨ We just wanted to take a moment to remind you how much we love connecting with each and every one of you! If you’re enjoying our content, why not shoot us a text and say hello? Your feedback means the world to us, and we’d love to hear from you! Your likes, comments, and shares help us grow and reach even more amazing people just like you. ❤️ Feel free to text us at (617) 870-2694 – whether you want to share what you like, suggest ideas, or just say hi! We can’t wait to hear from you! 💬