Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove tabs and pages from BuddyPress profile

  • Avatar of pixelguy
    pixelguy
    Participant

    @pixelguy

    Hi,

    i want to remove several tabs from the profile of any Buddypress user.

    I know, that i can remove them with something like this:

    $bp->bp_nav['groups'] = false;

    This works fine and removes the tabs. The problem is that the pages are still there and can be opened by typing in the url.

    Is there any solution to deactivate these pages without deactivating the whole function? I need this for following tabs: activity, groups and friends.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of Tecca
    Tecca
    Participant

    @tecca

    The easiest way I can think of is to copy the needed files over from the BuddyPress plugin (members/single/something.php), and place them into your theme, removing its contents or placing a redirect into the files.

    Avatar of pixelguy
    pixelguy
    Participant

    @pixelguy

    yeah, a redirect could be a solution. thanks!

    Avatar of pixelguy
    pixelguy
    Participant

    @pixelguy

    i added the following code at the top of the template:

    <?php
    status_header('301');
    $redirect = get_site_url();
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: ".$redirect);
    exit();
    ?>

    unfortunately it does not work. is there any trick?!

    Edit: when i activate the debug mode, i get this error:

    Warning: Cannot modify header information – headers already sent by

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Avatar of pixelguy
    pixelguy
    Participant

    @pixelguy

    thanks! but i get an error if i add the redirect (see above)

    EDIT: i added the code to the file members/single/groups.php for example

    Avatar of pixelguy
    pixelguy
    Participant

    @pixelguy

    OK, i solved it by putting the following code on top of the home.php. is that ok? it looks good…

    if ( bp_is_user_groups() or bp_is_user_activity() ) :
    	$current_user = wp_get_current_user();
    	$bp_profile_link=bp_core_get_user_domain( $current_user->ID);
    	bp_core_redirect($bp_profile_link);
    endif;
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Remove tabs and pages from BuddyPress profile’ is closed to new replies.