BuddyBoss Home – Web Support Forums Solutions Social Learner How Can I Exclude a Specified User Type from the Members Directory?

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

    #63707
    @dbayless

    I am using the “Subscriber” site role to designate inactive members. How might I exclude such inactive members from being included in the Member Directory? In the attached screenshot, “William Bayless” is inactive and has been assigned the Subscriber site role.

    From my research, I’m guessing that I need to modify the members-loop.php file and place the modified version in the appropriate Social Learner child directory.

    Any recommendations?

    Answers

    #63808
    @vapvarun

    Hi @dbayless

    You can use following apprach

    https://gist.github.com/sbrajesh/2142009

    Above example is demonstrated for subscriber

    Regards
    Varun Dubey

    #63810
    @dbayless

    As always, thank you Varun. I appreciate your help.

    #63839
    @vapvarun

    Welcome 🙂
    Regards
    Varun Dubey

    #63937
    @dbayless

    Thanks, again, Varun. This approached work for me.

    For anybody else who wants to use the above referenced code to exclude one or more member types from the BuddyPress members directory, a couple of notes:

    • Watch out for the fix in the penultimate line of the code. return $users; should be replaced with return $subscribers;
    • I appended the code the functions.php file in my /wp-content/themes/social-learner/ child theme folder.
    #63961
    @vapvarun

    Thanks @dbayless
    I will close this topic, feel free to create new for any further queries
    Regards
    Varun Dubey

Viewing 6 posts - 1 through 6 (of 6 total)
  • The question ‘How Can I Exclude a Specified User Type from the Members Directory?’ is closed to new replies.