Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Website Setup › Forms › Admin usernames to not appear in directory
- This topic has 3 replies, 2 voices, and was last updated 6 years, 7 months ago by
Themosaurus.
-
AuthorPosts
-
alexParticipant@abourne
- 81 Topics
- 259 Posts
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.
October 8, 2018 at 09:14 #2694@themosaurus- 1 Topics
- 1675 Posts
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,
October 8, 2018 at 14:41 #2705alexParticipant@abourne- 81 Topics
- 259 Posts
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' );
October 16, 2018 at 19:29 #2898@themosaurus- 1 Topics
- 1675 Posts
OK, great news if you’ve solved your issue.
Thank you very much for sharing this with the rest of our community.
Regards,
October 16, 2018 at 20:12 #2913 -
AuthorPosts
The topic ‘Admin usernames to not appear in directory’ is closed to new replies.