Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Compliance with Buddypress Private Profiles
This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko 3 years, 6 months ago.
- AuthorPosts
- November 24, 2019 at 12:00 pm #24718
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 3 years, 6 months ago by
VUTURE.
November 25, 2019 at 2:10 pm #24732Hi 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.
Best,
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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 28, 2019 at 1:12 pm #24793Hello 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,
LyssNovember 28, 2019 at 3:46 pm #24796Hi Lyss,
That would be completely perfect. I cannot access the ajax search pro menu dashboard however, the account does not have permissions.
Best,
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!
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 28, 2019 at 5:52 pm #24800You cannot access this content.November 29, 2019 at 9:26 am #24814Hi 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!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 30, 2019 at 11:49 am #24837Hello Ernest,
thank you for your collaboration!
Your snippet works perfectly. 🙂We provided this to youzer dev-team.
Best regards
ChrisDecember 2, 2019 at 8:30 am #24843You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
-
This topic was modified 3 years, 6 months ago by
- AuthorPosts
You must be logged in to reply to this topic.