BuddyDev

Search

[Resolved] Ability to search in the WP admin console for hidden users

  • Participant
    Level: Initiated
    Posts: 3
    Keri Brady on #9435

    Hi there —

    I’m working on a WordPress site that has the Profile Visibility Manager plugin installed, as well as BuddyPress. By default, all users are completely private and unsearchable. The issue is, we need to be able to manually add users to groups using BuddyPress in the admin console. When users are completely hidden, we can’t find them in search to add to the group.

    This topic is similar, but doesn’t work for our use case because it surfaces users on the front end only — and we need the functionality in the admin console: https://buddydev.com/support/forums/topic/bp-profile-visibility-manager/

    Thanks in advance for your help!

  • Participant
    Level: Initiated
    Posts: 3
    Keri Brady on #9444

    Hoping someone can help ASAP, we’re launching our site tomorrow and this feature is super important.

    Thank you!

  • Keymaster
    (BuddyDev Team)
    Posts: 24622
    Brajesh Singh on #9446

    Hi Keri,
    Apologies for the inconvenience.

    for now, Please modify the plugin like this

    1. Open bp-profile-visibility.php
    2. Please go to line 392, you will see something like this

    
    		//do not hide users inside the admin 
    		if ( is_admin() && ! defined('DOING_AJAX') ) {
    		   return ;
    		}
    

    3. Please add the following line above it

    
    
    if( is_super_admin()){
    return;
    }
    
    

    That will make all the users visible for super admin all the time and work for you.

    We are unable to fix it as a general issue as we do not know if the ajax request was generated from admin or non admin.

    Hope that helps.

  • Participant
    Level: Initiated
    Posts: 3
    Keri Brady on #9448

    Awesome — thank you so much! This works great for what we need.

    In the near future, our client wants to allow users with a custom user role (rather than the super admin role) to be able to see private users and add them to groups.

    In that case, would it be as simple as changing ( is_super_admin()) to the custom user role name?

  • Keymaster
    (BuddyDev Team)
    Posts: 24622
    Brajesh Singh on #9450

    Hi Keri,
    Thank you.

    WordPress does not offer any function to check for the role directly. You can use current_user_can(‘some_capability’) in that case to make it possible.

    Hope that helps.

  • Participant
    Level: Initiated
    Posts: 3
    Keri Brady on #9451

    Perfect, thanks for your help 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24622
    Brajesh Singh on #9452

    you are welcome. all the best with the launch 🙂

You must be logged in to reply to this topic.

This topic is: resolved