This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Compliance with Buddypress Private Profiles

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Compliance with Buddypress Private Profiles

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #24718
    VUTUREVUTURE
    Participant

    Hi there,

    we use Buddypress with this addon that members are able to make their profile private: https://buddydev.com/plugins/bp-profile-visibility-manager/

    Is it somehow possible to make ajax search compliant with that plugin, so it doesn’t show users that want to stay private. Alternatively there could be a “locked” overlay above the picture or a “locked”-icon somewhere in the area (description, on the right..).
    Just that people know, that they don’t need to click on it, because they wont find anything there.

    Picture of the private page and profile found in search: https://1drv.ms/u/s!Apu2w-jQ_0tCgbwWvio33sO-Ik-o8g

    If it’s not possible to do this now, we would suggest it for future updates 🙂

    Thanks in advance,
    Lyss

    • This topic was modified 6 years, 6 months ago by VUTUREVUTURE.
    #24732
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Lyss,

    It depends on how this information is stored. If the visibility is set as a user meta, then it might be even possible to create hidden user meta filter, that would automatically exclude the items.
    If the plugin has an API (function) to check if a user profile is private, then using that in a small custom code snippet would also work.
    Feel free to ask the plugin developer and let me know, there is definitely a way to do it one way or another.

    #24793
    VUTUREVUTURE
    Participant

    Hello Ernest,

    we asked Youzer, they wrote the private profile info is stored as user meta ‘yz_enable_private_account’.

    Would be great, if you could make it compatible. Youzer offers support if you need anything else.

    Feel free to test it out on our page, but please be gentle, because we are working on the page nonstop and don’t always have a best backup at hand.

    Thanks,
    Lyss

    #24796
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Lyss,

    That would be completely perfect. I cannot access the ajax search pro menu dashboard however, the account does not have permissions.
    I am not sure what values to suggest for the filter. Can you please check the permissions? I will try to check the meta values and quickly construct the correct filter.
    Thanks!

    #24800
    VUTUREVUTURE
    Participant

    You cannot access this content.

    #24814
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Lyss,

    Thank you very much. Well, a custom code will be required unfortunately.

    Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter('asp_results', 'asp_filter_users_by');
    function asp_filter_users_by($results) {
      foreach ($results as $k => &$r) {
        if ( $r->content_type == 'user' ) {
          $v = get_user_meta($r->id, 'yz_enable_private_account', true);
          if ( $v == 'on' ) {
            unset($results[$k]);
          }
        }  
      }
      return $results;
    }

    Please be careful, I obviously was not able to test this code. Thank you!

    #24837
    VUTUREVUTURE
    Participant

    Hello Ernest,

    thank you for your collaboration!
    Your snippet works perfectly. 🙂

    We provided this to youzer dev-team.

    Best regards
    Chris

    #24843
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.