Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide General Settings

  • Is it possible to hide the General Settings tab on a user’s profile page?

    The General Settings allow a user to change their password and email address. Our users will be ActiveDirectory users so we’d like to hide or remove or disable this page.

    WP 3.0.2
    BP 1.2.5.2

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Add the following to your theme’s functions.php:

    `function ray_bp_remove_settings() {
    global $bp;

    // removing the existing settings tab
    bp_core_remove_nav_item( $bp->settings->slug );
    }
    add_action( ‘init’, ‘ray_bp_remove_settings’, 0 );

    function ray_bp_readd_settings() {
    global $bp;

    // add a new settings tab to use notifications as default tab
    bp_core_new_nav_item( array( ‘name’ => __(‘Settings’, ‘buddypress’), ‘slug’ => $bp->settings->slug, ‘position’ => 100, ‘show_for_displayed_user’ => false, ‘screen_function’ => ‘bp_core_screen_notification_settings’, ‘default_subnav_slug’ => ‘notifications’ ) );

    // bug in bp_core_remove_subnav_item(), we have to hack the screen function so it displays the notifications screen when you land on /settings/
    if ( $bp->current_component == $bp->settings->slug && $bp->current_action == ‘general’ )
    add_action( ‘wp’, ‘bp_core_screen_notification_settings’, 3 );

    // add back the subnav notifications tab
    $settings_link = $bp->loggedin_user->domain . $bp->settings->slug . ‘/’;

    bp_core_new_subnav_item( array( ‘name’ => __( ‘Notifications’, ‘buddypress’ ), ‘slug’ => ‘notifications’, ‘parent_url’ => $settings_link, ‘parent_slug’ => $bp->settings->slug, ‘screen_function’ => ‘bp_core_screen_notification_settings’, ‘position’ => 20, ‘user_has_access’ => bp_is_my_profile() ) );
    }
    add_action( ‘init’, ‘ray_bp_readd_settings’ );`

    Tested lightly. Encountered a few bugs, but this will work…

    Worked perfectly, thanks r-a-y

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @r-a-y ,
    Thanks for the code! It’s perfect! Just one question–
    I not only moved the Settings but also other nav and sub-nav items, 2 of the sub-nav are added under a newly created nav slug. if a plugin adds a new item in any of the sub tab, can they find the right path? or I need to define some path for them?
    Thanks!

    Avatar of alienalias
    alienalias
    Participant

    @alienalias

    I know this is probably the dumbest question ever, but I am a non-techy type and could REALLY use some help. I don’t write nor understand code, but have successfully inserted multitudes of code successfully when given good instruction. So, I apologize for my lack of knowledge in advance, and also extend sincere thanks for your help. What I’m wondering is this:

    I have a membership site that auto-assigns passwords and such, so similarly to the original poster, I can’t have that “Settings” tab under my BuddyPress profiles and etc. However, I have NO idea exactly WHERE to place that code. I tried inserting it at the end of the code, at the line before the ending ?> . It doesn’t work.

    Furthermore, I need to make sure it is the correct function.php file. Should it be in the function.php file for the actual theme, or the BuddyPress child theme?

    THANK YOU so much for your help!

    Avatar of bp-help
    bp-help
    Participant

    @bphelp

    @alienalias
    You could just add some CSS to hide that tab in your child-themes style sheet:

    
    #user-settings {
        display: none;
    }
    

    Also, this thread is almost 2 1/2 years old. Its in bad form to reply to old threads. Start a new thread if the tip I gave you does not meet your requirement. The code that worked 2 1/2 years ago probably won’t work without changes.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.