This topic has 6 replies, 3 voices, and was last updated 9 years by abidjan-loves.
-
Author
-
July 14, 2014 at 14:57 #22524maxdestefanoParticipant
Hello,
I would like not to show some users in the members list.
For example I don’t want admins to be shown in the members list.
Thanks,
MaxJuly 17, 2014 at 12:30 #22840CatalinModeratorHello,
Please take a look at this link:
https://gist.github.com/sbrajesh/2142009#file-hide-subscribers-php
You can use the code to hide admin users, you need to change the last function.
Thank you,
CatalinHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 17, 2014 at 13:38 #22847maxdestefanoParticipantHello Catalin,
Thanks for your answer.
I copied and pasted this code inside the bp-custom.php file, and it seems to work great in the members list page.
However, I still have to hide the admins from a couple of sections:
– the online users widget
– the members list widgetThe code you suggested me seems not to do that. Could you please help?
Thanks
MaxJuly 21, 2014 at 11:05 #23040abidjan-lovesParticipantHi. I use this code and it works for me so `/**
* HIDE ADMIN
*/add_action(‘bp_init’, ‘kleo_private_admin’);
function kleo_private_admin(){
global $bp;
if(is_super_admin())
{
remove_action(“wp_head”,”bp_core_record_activity”); //id SM is on, remove the record activity hook
//then remove the last activity, if present
delete_user_meta($bp->loggedin_user->id, ‘last_activity’);
}
}add_action(‘bp_ajax_querystring’,’kleo_exclude_users’,20,2);
function kleo_exclude_users($qs=false,$object=false)
{
//list of users to exclude$excluded_user=’1′;//comma separated ids of users whom you want to exclude
if($object!=’members’)//hide for members only
return $qs;$args=wp_parse_args($qs);
//check if we are listing friends?, do not exclude in this case
if(!empty($args[‘user_id’]))
return $qs;if(!empty($args[‘exclude’]))
$args[‘exclude’]=$args[‘exclude’].’,’.$excluded_user;
else
$args[‘exclude’]=$excluded_user;$qs=build_query($args);
return $qs;
}`You can find it at this toptic : Hide Admin from site members
July 21, 2014 at 17:40 #23077maxdestefanoParticipantHi,
Thanks for your answer. This also works fine for the “members” PAGE, but not for the “who’s online” and the “members” WIDGETS.
Is there any solution for those two WIDGETS as well?Thanks
MaxJuly 22, 2014 at 16:40 #23199CatalinModeratorHello,
Those widgets are a part of BuddyPress plugin. Please try their forum support for a solution.
Thank you,
CatalinHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 20, 2015 at 15:21 #46873abidjan-lovesParticipantHi ,
well you can use Members With Uploaded Avatars Widget plugin for widget
http://buddydev.com/plugins/buddypress-members-with-uploaded-avatars-widget/
Thank you, -
AuthorPosts
The topic ‘Hide some users in members list’ is closed to new replies.