Support only during business hours : Monday to friday, from 8:30 am – 5:30 pm CEST

In regards to the COVID-19 situation

Your support team is currently doing their best to offer the best support possible despite the current COVID-19 situation. However during these exceptional circumstances, please note that you should expect a response time of 2-3 business days, until further notice.Rest assured that we will still do our best to handle your requests as soon as possible! Everyone stay safe and healthy! 😷

How to hide admin from members page

This topic is resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • Saad Ibra
    Participant
    • 2 Topics
    • 6 Posts
    @sio80

    Hello,
    I am currently working on setting the site on a local hosting and I am facing a problem with hiding the admin from the members page, I went to the support forums and read an article on this link Here and applied the second code, but this message appeared at the top of the site.

    Regards

    Manathan
    Keymaster
    Themosaurus Support
    • 0 Topics
    • 4644 Posts
    @themodactyl

    Hi @sio80,

    Thank you very much for reaching out! 🙂

    We wrote a tutorial in our documentation about this. To find out more, please click on the following link: How to Hide Admin Users in the Members Directory?.

    If you have further questions or requests, feel free to create other forum topics.

    We remain available for all matters related with our theme!

    Cheers,

    Saad Ibra
    Participant
    • 2 Topics
    • 6 Posts
    @sio80

    Hello ,

    Thank you for your interaction and response to my message. Yes, I followed these steps, but I received this error message. This is also a screenshot of the error line.

    Regards,

    Manathan
    Keymaster
    Themosaurus Support
    • 0 Topics
    • 4644 Posts
    @themodactyl

    Hi Saad,

    Thank you for your feedback. I’m sorry to read this article doesn’t help you get what you’re trying to achieve. Unfortunately, we have no clue on how to solve this. 🤔

    Please be aware that the directory is managed by BuddyPress. As this issue is related with this plugin, it’s best if you try to reach the plugin authors. They will be more informed and better suited to help you.

    To go further, we invite you to post your request on their support forums: buddypress.org/support

    Don’t hesitate to share the solution with us. I’m sure it will help other users facing the same issue. By doing this, you will be making a great contribution to this forum, and we thank you very much for that! #SharingIsCaring 💪🏻

    Best,

    Saad Ibra
    Participant
    • 2 Topics
    • 6 Posts
    @sio80

    Hello,
    I did it 🙂
    To hide admin from members page as well as widgets…etc, use this code. I modified it out of experience, not knowledge, and the result is great.

    /**
     * Exclude Members from BuddyPress Members List.
     *
     * @param string $qs query string.
     * @param string $object object name(members, groups etc).
     *
     * @return string
     */
    function bpdev_exclude_users( $qs = '', $object = '' ) {
        // 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;
     
    }
     
    add_action( 'bp_ajax_querystring', 'bpdev_exclude_users', 20, 2 );
    
    // Exclude Admins from Directories and BP Widgets 
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users' );
     
    function buddydev_exclude_users( $args ) {
        //do not exclude in admin
        
        $excluded = isset( $args['exclude'] )? $args['exclude'] : array();
     
        if( !is_array( $excluded ) ) {
            $excluded = explode(',', $excluded );
        }
        
        $user_ids = array( 1, ); // enter user ids here
        
        
        $excluded = array_merge( $excluded, $user_ids );
        
        $args['exclude'] = $excluded;
        
        return $args;
    }
    
    

    Regards

    Manathan
    Keymaster
    Themosaurus Support
    • 0 Topics
    • 4644 Posts
    @themodactyl

    Hi @sio80,

    I’m glad to read you’ve been able to solve this issue!

    We thank you for sharing the solution with us. I’m sure it will help other users facing the same issue. By doing this, you’re making a great contribution to this forum, and we thank you very much for that! #SharingIsCaring 💪🏻

    Cheers,

Roboraptor 🦖
Themosaurus Topic Closer

Hi there,

This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!

Best regards,
The Themosaurus team.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘How to hide admin from members page’ is closed to new replies.

Troubleshooting Demo Imports

You're trying to setup your theme but you're experiencing errors when importing the demo content? Or you've just followed the setup guide but your website doesn't look exactly like our demo? These are common issues for which you can find easy and quick fixes.

Happy With our Support So Far?

Feel free to review our theme on Themeforest! It helps us making our products more known to new potential customers, which allow us more time to improve the quality and develop new features. #SharingIsCaring ❤️

Discover MatchPress

Skip • Like • Super-Like

Add powerful matching features like Member likes, skips, super likes, conditional private messaging and much more.