BuddyDev

Search

[Resolved] Disable Member Directory

  • Participant
    Level: Initiated
    Posts: 4
    Brandi on #15650

    Is there a way to disable the BuddyPress Directory Completely? Meaning if you go to yourdomain.com/members there is no directory whatsoever

  • Keymaster
    (BuddyDev Team)
    Posts: 24622
    Brajesh Singh on #15666

    Hi Brandi,
    You can not completely disable it.

    The options are to either hide the member list by filtering on bp_after_has_members_parse_args or modify the members/index.php template to not show. I will go with the second option as it gives more control and allows you to hide the counts too.

  • Participant
    Level: Initiated
    Posts: 1
    Mimi on #17811

    Hi there! For those of us who don’t have ninja tech skills, can you please provide instructions on how to do the second option. Thanks!

  • Keymaster
    (BuddyDev Team)
    Posts: 24622
    Brajesh Singh on #17814

    Hi Mimi,
    Welcome to BuddyDev.

    Here is abetter strategy. We buffer the page content and discard it.

    
    
    /**
     * Start Buffering the members directory content.
     */
    function buddydev_start_members_dir_buffering() {
    	ob_start();
    }
    
    add_action( 'bp_before_directory_members', 'buddydev_start_members_dir_buffering', - 1 );
    
    /**
     * Discard the members directory content.
     */
    function buddydev_end_members_dir_buffering() {
    	// discard.
    	ob_end_clean();
    }
    
    add_action( 'bp_after_directory_members', 'buddydev_end_members_dir_buffering', 100001 );
    

    You can put it in your bp-custom.php or in your theme’s functions.php

    Hope it helps

    Regards
    Brajesh

The topic ‘ [Resolved] Disable Member Directory’ is closed to new replies.

This topic is: resolved