-
Author
Tagged: buddypress, member's, pmpro, remove
-
April 15, 2015 at 19:45 #54661
mitchcan
ParticipantHey,
I am trying to hide specific PMP roles from the BP members page in Kleo. The folks at PMP gave me some code that kinda sorta works. It DOES remove the member information, but leaves the empty box displayed where the information was.
I tried placing this code in either the custom plugin I had created for BP stuff, or the buddypress functions file within the Kleo theme (yes, if it worked there, I would have created/placed it instead in a child theme) 🙂 In neither case did it function as I expected. (see attached screencap)
Could you please let me know if it should a) go in a different place or b) if the code needs some specific Kleo tweak to work.
Thanks so much. Have as great day!
Attachments:
You must be logged in to view attached files.April 15, 2015 at 20:00 #54672mitchcan
ParticipantYou know, I should probably show the code I was using… that might be helpful. 🙂
COPY CODE/* * Hide certain membership levels in BuddyPress directory */ function my_bp_has_members($has_members, $members_template) { global $members_template; //pmpro membership levels to hide $levels = array(1,2,3); //get list of members $members = $members_template->members; foreach($members as $key=>$member) { if(pmpro_hasMembershipLevel($levels, $member->id)) unset($members_template->members[$key]); } return $has_members; } add_filter('bp_has_members', 'my_bp_has_members', 10, 2);April 20, 2015 at 03:03 #55169Andrei
ModeratorYou need to hide the entire profile form the listing, or just some information from it’s profile listing box ?
Looking forward.
CheersHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.

