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

Due to the decrease in our staff due to vacations, our response time may be longer.

Be sure we're doing our best to manage your topic as soon as possible.

Admin usernames to not appear in directory

This topic is resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • alex
    Participant
    • 81 Topics
    • 259 Posts
    @abourne

    How to blacklist admin profiles to not appear in the swipe deck/member directory? Admin should not be discovered by public. Profiles should be private from being searched in the directory. Please share how to label it as such.

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    Hi @abourne,

    Thank you for bring this issue to our attention. Maybe these topics will help you to solve your issue as they seem to answer the same concern:
    https://buddypress.org/support/topic/hide-admin-from-members-and-activity/
    https://buddypress.org/support/topic/how-to-hide-admin-accounts-2016/
    https://buddypress.org/support/topic/hide-certain-admins-as-being-online/

    Please note that this issue is related with the customization of BuddyPress, not with the use of Gwangi. As theme authors, the installation, setting or debugging of third party plugins isn’t part of the support we will provide for our theme (Gwangi) and our plugins (Grimlock suite).

    To go further, we invite you to ask for more help from the plugin authors and post your request on their support forums:
    https://buddypress.org/support/

    We remain available for all support requests related with the use of your theme.

    Regards,

    alex
    Participant
    • 81 Topics
    • 259 Posts
    @abourne

    Thanks. Found solution which removes from all directory areas:

    /**
     * Exclude Users from BuddyPress Members List by WordPress role.
     *
     * @param array $args args.
     *
     * @return array
     */
    function buddydev_exclude_users_by_role( $args ) {
        // do not exclude in admin.
        if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
            return $args;
        }
     
        $excluded = isset( $args['exclude'] ) ? $args['exclude'] : array();
     
        if ( ! is_array( $excluded ) ) {
            $excluded = explode( ',', $excluded );
        }
     
        $role     = 'administrator';// change to the role to be excluded.
        $user_ids = get_users( array( 'role' => $role, 'fields' => 'ID' ) );
     
        $excluded = array_merge( $excluded, $user_ids );
     
        $args['exclude'] = $excluded;
     
        return $args;
    }
     
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users_by_role' );
    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    OK, great news if you’ve solved your issue.

    Thank you very much for sharing this with the rest of our community.

    Regards,

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

The topic ‘Admin usernames to not appear in directory’ 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.

Setup Your Cera or Gwangi powered Community Website and Turn it into an iOS and Android App

15% discount for Cera users

To unleash the full power of your Cera or Gwangi theme, we have partnered with the Zipline team. Your community website can now be fully setup and turned into your very own custom app for iOS and Android.

Whether you've newly acquired the theme or already got your site up and running, Zipline got you covered. And we got you an incredible discount.

Holiday, Weather & Festive effects
to pimp your WordPress Site