BuddyBoss Home – Web Support Forums Solutions Social Learner How do I hide Admins from the Members list?

Tagged: 

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

    #57699
    @infoteam

    I want to hide all admins from the Members list because I have special users set up to admin the site but should not be seen by other users.

    How is this accomplished with the Social Learner/BuddyPress setup?

    Thanks,L
    Ellen

    Answers

    #57844

    Anonymous
    @

    Hi @infoteam
    Please take a look of following thread, hopefully it will solve what exactly you are looking for

    https://buddypress.org/support/topic/hide-admin-from-members-and-activity/

    Regards
    Varun Dubey

    #57854
    @infoteam

    Thanks! I tried searching here for various combinations of “hide admins”, but never found that page. I should be able to sort it out from there.

    Cheers!
    Ellen

    #57962

    Anonymous
    @

    Hi @infoteam, add this function in your theme’s function.php

    
    add_action('bp_ajax_querystring','buddyboss_exclude_users',20,2);
    function buddyboss_exclude_users($qs=false,$object=false){
        //list of users to exclude
       
        $excluded_user='1,2,3';//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 searching for friends list etc?, do not exclude in this case
        if(!empty($args['user_id'])||!empty($args['search_terms']))
            return $qs;
        
        if(!empty($args['exclude']))
            $args['exclude']=$args['exclude'].','.$excluded_user;
        else 
            $args['exclude']=$excluded_user;
          
        $qs=build_query($args);
       
       
       return $qs;
        
    }
    

    Regards

Viewing 4 posts - 1 through 4 (of 4 total)
  • The question ‘How do I hide Admins from the Members list?’ is closed to new replies.