Skip to:
Content
Pages
Categories
Search
Top
Bottom

Settings nav in profile


  • Pete Deane
    Participant

    @pete-deane

    Hi

    I’m trying to edit the navigation under the settings tab in a user profile so it only displays the delete account option as a default.

    Can anyone help please?

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

  • Pete Deane
    Participant

    @pete-deane

    I have this so far but nothing is happening. Am I doing it right.

    
    function remove_settings_nav() {
        global $bp;
        bp_core_remove_subnav_item( $bp->settings->slug, 'general' );
    }
    add_action( 'init', 'remove_settings_nav' );
    
    

    I am wanting to remove the links for General settings, notifications and capabilities.

    How would the code need to adapted to work how I need it to?


    Boone Gorges
    Keymaster

    @boonebgorges

    This is pretty close to being right. I think ‘init’ is too early; try hooking to ‘bp_actions’ instead.

    Also, you may find that you have to reset the default tab for ‘settings’ before removing the subnav items (or you’ll get funny redirect loops). Use `bp_core_new_nav_default()` for this.


    Pete Deane
    Participant

    @pete-deane

    not following. I’m a beginner and actually grabbed that code from somewhere else and changed some names. that is all!!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Settings nav in profile’ is closed to new replies.
Skip to toolbar