BuddyDev

Search

How to hide group settings tab?

  • Participant
    Level: Initiated
    Posts: 1
    Matthew Webb on #24538

    All our groups will be set to private and any member can invite new members. The group settings tab is now useless, but I cannot figure out how to remove it from the group creation process.We have the BuddyPress Group Tabs Creator Pro plugin, and I thought it could override the default tabs, but I can’t seem to make it work. Can I do this with the plugin or is it even possible with in-house code?

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #24539

    Hi Matthew,
    Welcome to BuddyDev forums.

    The tabs creators pro allows you to add any tab/sub tab. It allows removing top level tabs from group but not from group creation.

    You can use the following code to remove th settings tab from group creation.

    
    /**
     * Remove group settings from group creation.
     */
    add_filter( 'groups_create_group_steps', function ( $steps ) {
    	unset( $steps['group-settings'] );
    
    	return $steps;
    } );
    
    

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 1
    Matthew Webb on #24545

    Thank you, that got me almost to where I need.

    That removed it from the group creation phase. Any idea how I can remove the settings tab from the group manage sub-nav.

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #24555

    Hi Matthew,
    Please add the following lines too

    
    
    /**
     * Remove group admin/settings sub nav.
     */
    function buddydev_remove_group_admin_settings() {
    
    	if ( ! bp_is_group() ) {
    		return;
    	}
    
    	bp_core_remove_subnav_item( groups_get_current_group()->slug . '_manage', 'group-settings', 'groups' );
    
    	// reattach screen function to avoid 404.
    	add_action( 'bp_screens', 'groups_screen_group_admin', 3 );
    }
    
    add_action( 'bp_template_redirect', 'buddydev_remove_group_admin_settings', 1 );
    

    That will remove the settings from manage too.

    Hope that helps.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved