This topic has 10 replies, 4 voices, and was last updated 9 years by Mirek.

  • Author
  • #4565
     gideon1210
    Participant

    Under the profile tab how do you remove the view section

    #4579
     adam
    Participant

    I assume it can be done like they show here: http://wpmu.org/daily-tip-how-to-remove-mentions-from-buddypress/ (which was something I wanted to do).

    I’ve tried adding this to functions.php:

    function ray_remove_view_nav() {
    global $bp;

    bp_core_remove_subnav_item( $bp->profile->slug, ‘view’ );
    }
    add_action( ‘init’, ‘ray_remove_view_nav’ );

    But, it’s not working. My guess is ‘view’ is the wrong slug name, but I don’t know what it is.

    #4581
     gideon1210
    Participant

    I found the slug its public, is there anyway of changing the default link on the Profile tab so it links to edit instead of public

    #4596
     SQadmin
    Keymaster

    Hi,
    This code added to wp-content/bp-custom.php ges the job done

    COPY CODE
    
    
    function my_change_profile_default_subnav() {
        global $bp;
        bp_core_new_nav_default(array( 'parent_slug' => $bp->profile->slug, 'screen_function' => 'bp_profile_screen_edit', 'subnav_slug' => 'edit'));
    }
    add_action( 'bp_setup_nav', 'my_change_profile_default_subnav' );
    

    but you won’t be able to see other users’s profile tab

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #4614
     adam
    Participant

    Hi @sqadmin – this code worked, thanks! but, how do I get rid of the View tab? it’s still shows to the left of Edit, even though when you click on it it reverts back to edit.

    #4615
     gideon1210
    Participant

    function ray_remove_public_nav() {
    global $bp;

    bp_core_remove_subnav_item( $bp->profile->slug, ‘public’ );
    }
    add_action( ‘init’, ‘ray_remove_public_nav’ );

    #4617
     adam
    Participant

    I put that in my functions.php, but my View tab still shows 🙁

    #4618
     SQadmin
    Keymaster

    Instead of your add_action(); add this add_action( ‘bp_setup_nav’, ‘ray_remove_public_nav’ );

    And add this code to plugins/bp-custom.php

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #4619
     adam
    Participant

    I’ve added this to bp-custom.php:

    function ray_remove_public_nav() {
    global $bp;
    bp_core_remove_subnav_item( $bp->profile->slug, ‘public’ );
    }
    add_action( ‘bp_setup_nav’, ‘ray_remove_public_nav’ );

    but still can’t get it to remove the View tab. i refreshed my cache too in case that was the issue. any other ideas? thanks for your help.

    #4621
     adam
    Participant

    Got it! I put this in bp-custom.php:

    function remove_profile_view() {
    bp_core_remove_subnav_item( ‘profile’, ‘public’ );
    }
    add_action( ‘bp_setup_nav’, ‘remove_profile_view’, 100 );

    #86495
     Mirek
    Participant

    hi,
    Is it still possible to set sub tabs (‘edit’) as defaults when visiting profile ?

    cuz I can’t get it to work …

    COPY CODE
    function my_change_profile_default_subnav() {
        global $bp;
        bp_core_new_nav_default(array( 'parent_slug' => $bp->profile->slug, 
    	'screen_function' => 'bp_profile_screen_edit',
    	'subnav_slug' => 'edit')
    	);
    }
    add_action( 'bp_setup_nav', 'my_change_profile_default_subnav', 5 );

    it’s give me 404 error.

    Thanks for any advice.
    Cheers
    Mirek

Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?