BuddyBoss Home – Web › Support Forums › Solutions › Social Learner › How Can I Exclude a Specified User Type from the Members Directory?
Tagged: buddypress, members directory, social learner
- This topic has 5 replies, 2 contibutors, and was last updated 8 years ago by Varun Dubey.
Question
March 17, 2016 at 6:24 pm #63707@dbaylessI 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
March 18, 2016 at 7:06 am #63808@vapvarunHi @dbayless
You can use following apprach
https://gist.github.com/sbrajesh/2142009
Above example is demonstrated for subscriber
Regards
Varun DubeyMarch 18, 2016 at 7:22 am #63810@dbaylessAs always, thank you Varun. I appreciate your help.
March 18, 2016 at 10:13 am #63839@vapvarunWelcome 🙂
Regards
Varun DubeyMarch 18, 2016 at 6:09 pm #63937@dbaylessThanks, 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.
March 18, 2016 at 11:07 pm #63961@vapvarunThanks @dbayless
I will close this topic, feel free to create new for any further queries
Regards
Varun Dubey
- The question ‘How Can I Exclude a Specified User Type from the Members Directory?’ is closed to new replies.