Hide the General tab and page from the Settings link on BuddyPress

Hello,
On this page: http://yourtechadvisors.com/members/yourtechadvisors/settings/
There are two things I would like to do.

1. Hide the tab named General.
2. Change where you land after clicking the Settings link, I would like to have users land on the Email tab instead of the General tab.

Would this be possible? Support access is open.

Thanks.

  • Milan

    Hello @alexstine,

    I hope you are well today. :slight_smile:

    Actually using Adam's trick removes general tab but as its default tab for settings page it causes "Oops page not found error". So basically to hide that default tab and make our "Email" tab default one we need to do little bit of custom coding. :slight_smile:

    So please follow these steps. :slight_smile:

    #1) Open up /wp-content/plugins/buddypress/bp-settings/classes/class-bp-settings-component.php file and look at line no. 105 and 106. Those lines determines which will be default tab and which function will be used to render that tab's content.
    #2) So now change "screen_function" parameter which you will see on line no 105 value to "bp_settings_screen_notification" and "default_subnav_slug" which is on line no 106 value to "notifications". Final output will look something like this.

    // Add the settings navigation item.
    		$main_nav = array(
    			'name'                    => __( 'Settings', 'buddypress' ),
    			'slug'                    => $slug,
    			'position'                => 100,
    			'show_for_displayed_user' => $access,
    			'screen_function'         => 'bp_settings_screen_notification',
    			'default_subnav_slug'     => 'notifications'
    		);

    ( Note: we have to go this way as direct change in those parameter via hook is not working anymore )
    #3) Save file.
    #4) Add my colleague Adam's code in your active theme's functions.php file or better if in child theme's functions.php file. :slight_smile:

    As this solution targets core files, so please take backup of these changes before you proceed for update. Please do conduct these tests and let me know if you need further assistance on this.

    Cheers,
    Milan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.