This topic has 8 replies, 3 voices, and was last updated 9 years by NetConcept.

  • Author
  • #42436
     konnectworks
    Participant

    How do I make administrators of my site private so they do not show up as members of the site.

    Attachments:
    You must be logged in to view attached files.
    #42772
     Radu
    Moderator

    Add this code to your sweetdate-child theme functions.php

    COPY CODE
    
    // Remove admin from the member directory
    function bpdev_exclude_users($qs=false,$object=false){
        
        $excluded_user='1'; // Id's to remove, separated by comma
    	
        if($object != 'members' && $object != 'friends')// hide admin to members & friends 
        return $qs;
    	
        $args=wp_parse_args($qs);
    
        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;
    	
    }
    add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
    
    // once admin is removed, we must recount the members !
    function bpfr_hide_get_total_filter($count){
        return $count-1;
    }
    add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #42804
     konnectworks
    Participant

    I don’t have a child-theme for Sweetdate is what I was told from my web site developer. Do I have to have one?

    #42809
     konnectworks
    Participant

    Sorry…I was misinformed. I do have a child-theme but my website has been setup and configured using the main theme.

    Does this cause an issue?

    #42845
     Radu
    Moderator

    No, it can not cause a problem paste code in your child theme functions

    Let me know if it works.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #49413
     NetConcept
    Participant

    Hello Radu,
    I used your code to hide the admin, and it works only intermittently. Regardless of clearing browser history or not.

    I’m very disappointed with BuddyPress not offering this in their core to hide the admin. Why should the site admin be forced to have a profile?

    After all, we all go through a lot of trouble not using the WP “admin” for the back end, and change DB prefixes for security reasons to mention a few, yet BuddyPress forces one to reveal the admin username liberally. I tried turning Activity Streams off, but it makes no difference.

    Hence, this is not just an inconvenience, but a major security risk! If I can’t find a solution for this I’ll have to disable the BuddyPress plugin, and purchase a script catering specifically to online dating.

    As much as I like the WP based idea and the looks of SweetDate, but for tight membership control there are yet major obstacles to overcome, and the SweetDate theme not being compatible with the DS Plugin, does not help either.

    #49506
     Radu
    Moderator

    Hello NetConcept,

    Also try this solution https://archived.seventhqueen.com/forums/topic/admin-profile-2

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #49612
     NetConcept
    Participant

    Thanks Radu… much appreciated!

    I hope the second code keeps the admin hidden in all cases.

    In the meantime I figured out what caused the admin to show at certain times. I’m using the “BP Registration Options” plugin, and any time someone registered, and the “All Members” count increased by 1, that’s when the admin became visible, but the plugin correctly prevented the new user from showing, until approved.

    Disabling the plugin made no difference, only approval or deletion of the new member made the admin invisible again.

    Very strange, and never a dull moment, as certainly all images an any test profile no longer enlarge and return the “The content could not be loaded” error. Something to do with the resent RT update perhaps, because everything worked before.

    #50038
     NetConcept
    Participant
    This reply has been set as private.
Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?