Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Can we hide a student profile from search results
- This topic has 12 replies, 4 voices, and was last updated 2 years, 7 months ago by Veronica.
Viewing 14 posts - 1 through 14 (of 14 total)
-
AuthorPosts
-
September 20, 2021 at 5:49 am #371116AdamSpectatorFor example, a student is subscribed to an instructor's course and the instructor can search that student and easily find him/her. This is working. But is it possible, if a student hide from search engine and then noone will find him only the courses he subscribed/purchased then only those instructors can find him? Currently in extended profile tab in user profile in wordpress dashboard, we can hide/show few fields of each user for example, sex, email, phone etc. But we dont see any option to completely hide the profile from public search or if anyone searches from PWA dashboard. Our site is: https://www.hublearn.com/September 20, 2021 at 6:09 am #371120MrVibeKeymasterif you can share screenshots on which all places you need exclusion then we can give you a fix.September 20, 2021 at 12:08 pm #371145AdamSpectatorhttps://screencast-o-matic.com/watch/crQYQvV6F6fSeptember 21, 2021 at 1:32 pm #371260Anshuman SahuKeymasterYes you are right the profile field visibility settings are not saving . Adding to issue log : https://trello.com/c/Ool5gqYB actually the profile field visibility settings saves automatically when you change its value . that save changes button is just for email and password update . The search and select the zoom meeting form is there when you want to share meeting with specific persons and for that , that search is provided .It has nothing to do with the profile field visibility settings . We have to check if we can limit the search results or not checking the visibility .September 21, 2021 at 3:48 pm #371272AdamSpectatorWhat we want is if I hide my profile then no one can find me. From profile settings, if i hide myself then in meeting search field if someone types my name, name shouldnt be found. Is it possible ?September 23, 2021 at 2:22 pm #371445Anshuman SahuKeymasterplease try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
add_Action('template_redirect',function(){ $user_id = bp_displayed_user_id(); $meta = get_user_meta($user_id,'bp_xprofile_visibility_levels',true); if(!empty($meta) && !empty($meta[1]) && $meta[1]=='adminsonly'){ wp_die('Profile cannot be accessed'); } },1);
September 23, 2021 at 3:50 pm #371454AdamSpectatorCan I add this code in functions.php file of our child theme ?September 24, 2021 at 8:03 am #371475Anshuman SahuKeymasterYes that will also do the trick and on updates your code wont lost .September 24, 2021 at 3:06 pm #371505AdamSpectatorI tested the code but it does not work as we wanted. What it does it blocked to view the user profile but their name can be searched. In PWA dashboard in profile field visibility settings, we can set the name: Only me. It means only that profile can view their profile whick works. https://www.awesomescreenshot.com/image/13977949?key=fc87f5604db705b68e3c14a20e8f3b45 But when we search by their name from the admin/instructor PWA dashboard, for example in zoom meeting section, their name shows up when we type their name. It means their name is public. We don't want that. Can you please have a look ?September 27, 2021 at 1:27 pm #371669Anshuman SahuKeymasterPlease also add this code : please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :add_filter('vibe_zoom_search_sharing_values',function($return,$request){ if(!empty($return['values'])){ $args = json_decode($request->get_body(),true); if(!empty($args['shared_type'])){ $scope = $args['shared_type']; if($scope=='shared'){ $new_results = []; foreach($return['values'] as $k=> $v){ $meta = get_user_meta($v,'bp_xprofile_visibility_levels',true); if(!empty($meta)){ if(!empty($meta) && !empty($meta[1]) && $meta[1]=='adminsonly'){}else{ $new_results[] = $v; } } } $return['values'] = $new_results; } } } return $return; },10,2);
September 27, 2021 at 4:01 pm #371685AdamSpectatorthis code even hide all users from zoom (shared with) field. Can't find any user when typing their names. After I remove the above code, then i can find all users even the user name is private. So its not working.September 28, 2021 at 1:05 pm #371727Anshuman SahuKeymastersorry please try this code ,I tested this :add_filter('vibe_zoom_search_sharing_values',function($return,$request){ if(!empty($return['values'])){ $args = json_decode($request->get_body(),true); if(!empty($args['shared_type'])){ $scope = $args['shared_type']; if($scope=='shared'){ $new_results = []; foreach($return['values'] as $k=> $v){ $meta = get_user_meta($v['id'],'bp_xprofile_visibility_levels',true); if(!empty($meta) && !empty($meta[1]) && $meta[1]=='adminsonly'){}else{ $new_results[] = $v; } } $return['values'] = $new_results; } } } return $return; },10,2);
September 28, 2021 at 1:24 pm #371731AdamSpectatorThank You its now working.September 29, 2021 at 11:58 am #371780VeronicaModeratorgood to know closing this one -
AuthorPosts
Viewing 14 posts - 1 through 14 (of 14 total)
- The topic ‘Can we hide a student profile from search results’ is closed to new replies.