Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Website Setup › Pages › Hide Admin User
- This topic has 5 replies, 2 voices, and was last updated 6 years, 3 months ago by
Themosaurus.
-
AuthorPosts
-
@themosaurus
- 1 Topics
- 1675 Posts
Hi @creation,
There is no option in BuddyPress to hide admin users, but you can resolve this issue by using the following plugin that was kindly shared by a member of our community @abourne 🙂
That plugin has an option to hide members from the member directory by their role, which means you can use it to hide all admin users from the directory.
Hope this helps you resolve your issue.
Regards
December 6, 2018 at 17:18 #4108@themosaurus- 1 Topics
- 1675 Posts
Ok, it looks like this plugin unfortunately has some issue, so we advise that you uninstall it.
Could you try using the following PHP code snippet instead:
// Remove admin from the member directory function gwangi_hide_admins( $qs = false, $object = false ) { $excluded_user = implode( ',', get_users( 'role=administrator&fields=ID' ) ); 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', 'gwangi_hide_admins', 20, 2 );
To find out how to add a PHP code snippet to your website, we advise that you take a look at this article of our documentation:
Regards
December 6, 2018 at 18:09 #4114@themosaurus- 1 Topics
- 1675 Posts
You’re welcome. ?
Best regards,
December 7, 2018 at 10:58 #4120 -
AuthorPosts
The topic ‘Hide Admin User’ is closed to new replies.