Build online communities, sell courses & memberships on WordPress Support Forums Plugins BuddyPress Member Types How to Remove "Teacher" and "Student" Member Types from Directory Filters?

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Question

    #61183
    @dbayless

    I'm using Boss/Social Learner/Sensei/BP for Sensei. Apparently by default, BP for Sensei creates two member types (Teacher and Student) and includes those types in the directory filter at the top of the /members/ page.

    I used the BuddyPress Member Types plugin to create two new member types – Guides and Members, which I'd like to use in lieu of the default Teacher/Student types. I've successfully designated my current users as a Guide or Member, as show in the attached screenshot.

    What is the best way for me to remove the Teacher and Student directory filter options? I'd like to have the filter bar read All Members/My Friends/Guides/Members.

    Answers

    #61766
    @dbayless

    Any suggestions on how I might hide these member types from the directory filters?

    #62099
    @vapvarun

    Hi @dbayless
    you can use following function inside child theme functions.php to remove them.

    
    function bp_sensei_remove_tabs() {
       global $bp, $BUDDYPRESS_SENSEI;
    remove_action( 'bp_members_directory_member_types', array( $BUDDYPRESS_SENSEI->bp_sensei_loader, 'bp_sensei_members_directory' ) );
    }
    add_action( 'bp_init', 'bp_sensei_remove_tabs');
    

    Regards
    Varun Dubey

    #62236
    @dbayless

    Thank you, Varun. I'm having trouble getting the code to work. I'll follow-up if I can't. In the meantime, I appreciate your suggestions, as always.

    #63044
    @vapvarun

    Hi @dbayless, Hopefully above code worked fine. I have also tested on sensei install and it worked fine.

    I will close this topic, feel free to create new for any further queries.

    Regards
    Varun Dubey

Viewing 5 posts - 1 through 5 (of 5 total)
  • The question ‘How to Remove "Teacher" and "Student" Member Types from Directory Filters?’ is closed to new replies.