Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • entoen
    Participant

    @kamerhuren

    label[for=”send-to-input”]
    {
    display:none!important;
    }


    entoen
    Participant

    @kamerhuren

    YES!!!
    Thank you so much for your help.


    entoen
    Participant

    @kamerhuren

    i found out that it only work when i try to remove a core buddypress nav like ‘messages’ or ‘friends’. With a custom nav or subnav it doesn’t work. Any ideas why?


    entoen
    Participant

    @kamerhuren

    hi, thanks for pointing that out. it still doesn’t work. could you point me in a direction where the problem could be?


    entoen
    Participant

    @kamerhuren

    Hi, thank you for your message. The link shows solutions for the role a visitor has when on a profile page. I would like to remove a tab on a profile when the profile owner (bp_displayed_user_id) doesn’t have a certain role.
    I think i am close but i could be miles off:(
    Here is where i am but it doesnt work

    //Disable bookings subnav by role of the displayed user id.
     
    function remove_bookingtab_by_displayed_role() {
    
        // Get Current User Data.
        $user = get_userdata( bp_displayed_user_id() );
    
        // Get Roles.
        $roles = (array) $user->roles;
    	
    // exclamationmark means not in array i hope
        if (!in_array( 'translator', $roles ) ) {
    		bp_core_remove_subnav_item( 'bookings','booking' );
    	}
    	
    }
    
    add_action( 'bp_setup_nav', 'function remove_bookingtab_by_displayed_role', 15 );
    

    entoen
    Participant

    @kamerhuren

    Shane, after my three days it took you three minutes tops probably.

    Thank you so much.

Viewing 6 replies - 1 through 6 (of 6 total)
Skip to toolbar