Skip to:
Content
Pages
Categories
Search
Top
Bottom

Eliminate buddypress pages


  • SrGato29
    Participant

    @jonadeis

    Buddypress VersiĆ³n 2.6.1.1
    Wordpress Version 4.5.4

    Is there a way to eliminate or block the followings pages ???

    domain/members/username/settings/notifications/
    domain/members/username/settings/capabilities/
    domain/members/username/settings

    Because it is very important that users cant enter to those pages

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

  • modemlooper
    Moderator

    @modemlooper

    If you remove settings tab it auto removes all child pages.

    function w24dr_remove_settings_nav() {
          bp_core_remove_nav_item( bp_settings_slug() );
       }
    add_action( 'bp_setup_nav', 'w24dr_remove_settings_nav' );

    SrGato29
    Participant

    @jonadeis

    Hi there ,

    Thanks for your response, I tried your function, but without success, I try this function which I found on internet

    function my_remove_em_nav() {
    	global $bp;
          bp_core_remove_nav_item( 'settings' );
       
    
    }
    add_action( 'bp_init', 'my_remove_em_nav' );

    Thanks


    ckchaudhary
    Participant

    @ckchaudhary

    If you are on latest version of buddypress( > 2.6 ), the following code will work:

    //hide setting nav in profile
    function w24dr_remove_settings_nav() {
        $bp = buddypress();
        $bp->members->nav->delete_nav( bp_get_settings_slug() );
    }
    add_action( 'bp_setup_nav', 'w24dr_remove_settings_nav' );
    
    //redirect settings to main profile page
    function w24dr_redirect_settings_nav(){
        if( bp_is_user() && bp_is_current_component( bp_get_settings_slug() ) ){
            wp_redirect( bp_displayed_user_domain() );
            exit();
        }
    }
    add_action( 'template_redirect', 'w24dr_redirect_settings_nav' );

    But it still doesn’t remove ‘settings’ nav from adminbar. You need to work some more to remove it from there.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar