Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • chrishustert
    Participant

    @chrishustert

    Thanks David, but I have found another cool solution. It’s not Pet Owner and Pet Groomer anymore though.
    Hope it helps other people, too!

    
    **
     * Remove certain tabs from user profile based on member role.
     */
    function buddydev_remove_tabs_based_on_member_roles() {
    	if ( ! bp_is_user() ) {
    		return;
    	}
        
        $premium_dog_owner = bp_current_user_can( 'premium_dog_owner' );
        $premium_dog_borrower = bp_current_user_can( 'premium_dog_borrower' );
        
        $premium_user = ($premium_dog_owner ? : $premium_dog_borrower);
        
        if ( ! $premium_user ) {
            bp_core_remove_nav_item( 'friends' ); //removes the tab friends
            bp_core_remove_nav_item( 'messages' ); //removes the tab messages
            bp_core_remove_nav_item( 'reviews' ); //removes the tab reviews
        }
    
    }
    
    add_action( 'bp_setup_nav', 'buddydev_remove_tabs_based_on_member_roles', 1001 );
    
Viewing 1 replies (of 1 total)
Skip to toolbar