How to set Profile Visibility Lock in BuddyPress Private Community Pro Plugin

Profile Visibility Lock

As the plugin provides [ Profile Visibility Lock ] setting for members to set the profile visibility level, the plugin needs to override the BuddyPress default members home template, but if you are using a theme that already overrides BuddyPress templates than you may not be able to see the desired structure of members page which your theme uses as the plugin uses buddypress core template file. To solve the issue you may need to copy the structure from your theme/buddypress/members/single/home.php to plugins overrired file. Please follow the following steps to accomplish the task.
  1. Search in your theme directory that if there is a file present at the path BuddyPress/members/single/home.php file.
  2. If the file is present in parent theme copy the home.php file content and place it inside the buddypress-private-community-pro/templates/members/single/home.php.
  3. Once you copy theme's file to the plugin's file, add $blpro_prof_visib = apply_filters( 'blpro_profile_visility_home_override', $visib = true ); after do_action( 'bp_before_member_body' );.
  4. Now, you are supposed to find and replace following content.
Find following content in the home.php file :
  1. if ( bp_is_user_front() ) :
  2. bp_displayed_user_front_template_part();
  3. elseif ( bp_is_user_activity() ) :
  4. bp_get_template_part( 'members/single/activity' );
  5. elseif ( bp_is_user_blogs() ) :
  6. bp_get_template_part( 'members/single/blogs'    );
  7. elseif ( bp_is_user_friends() ) :
  8. bp_get_template_part( 'members/single/friends'  );
  9. elseif ( bp_is_user_groups() ) :
  10. bp_get_template_part( 'members/single/groups'   );
  11. elseif ( bp_is_user_messages() ) :
  12. bp_get_template_part( 'members/single/messages' );
  13. elseif ( bp_is_user_profile() ) :
  14. bp_get_template_part( 'members/single/profile'  );
  15. elseif ( bp_is_user_forums() ) :
  16. bp_get_template_part( 'members/single/forums'   );
  17. elseif ( bp_is_user_notifications() ) :
  18. bp_get_template_part( 'members/single/notifications' );
  19. elseif ( bp_is_user_settings() ) :
  20. bp_get_template_part( 'members/single/settings' );
  21. // If nothing sticks, load a generic template
  22. else :
  23. bp_get_template_part( 'members/single/plugins'  );
  24. endif;

Wrap above content with an if condition like below:

  1. if ( $blpro_prof_visib ) {
  2. if ( bp_is_user_front() ) :
  3. bp_displayed_user_front_template_part();
  4. elseif ( bp_is_user_activity() ) :
  5. bp_get_template_part( 'members/single/activity' );
  6. elseif ( bp_is_user_blogs() ) :
  7. bp_get_template_part( 'members/single/blogs'    );
  8. elseif ( bp_is_user_friends() ) :
  9. bp_get_template_part( 'members/single/friends'  );
  10. elseif ( bp_is_user_groups() ) :
  11. bp_get_template_part( 'members/single/groups'   );
  12. elseif ( bp_is_user_messages() ) :
  13. bp_get_template_part( 'members/single/messages' );
  14. elseif ( bp_is_user_profile() ) :
  15. bp_get_template_part( 'members/single/profile'  );
  16. elseif ( bp_is_user_forums() ) :
  17. bp_get_template_part( 'members/single/forums'   );
  18. elseif ( bp_is_user_notifications() ) :
  19. bp_get_template_part( 'members/single/notifications' );
  20. elseif ( bp_is_user_settings() ) :
  21. bp_get_template_part( 'members/single/settings' );
  22. // If nothing sticks, load a generic template
  23. else :
  24. bp_get_template_part( 'members/single/plugins'  );
  25. endif;
  26. }
Once you replace the content you will be able to see the results generated by the plugin. Suppose if a member A has set Profile Visibility to friends only then a member B who is not friend of A will see message like below if he/she tries to access member A's profile.



    • Related Articles

    • Profile Fieldsets Option

      Initially, the plugin provides three profile groups set. Education Professional Experience Contact Details Site admin can add, edit, delete the groups. All the groups related setting is provided under Groups Settings section. Plugin's admin setings : ...
    • Logged-out User Setting

      This plugin provides following setting for logged-out users. Lock BuddyPress Components Enable this option, if you wish to restrict the access of BuddyPress Components for logged-out users. Once you'll enable the 'Lock BuddyPress Components' option, ...
    • Profile Group Fields Options

      We have created lots of fields type and you are free to add new fields to each field groups under Fields Settings section in plugin's admin settings. Plugin's admin settings: Fields Settings SectionThe fields setting section helps in setting Field ...
    • Backend Option Setting

      PeepSo bbPress Tab Setting Navigate to PeepSo > Configuration > PeepSo bbPress Addon. Here you can enable or disable bbPress tab. If the tab is enabled then it will show in PeepSo user Profile Section. bbPress Activity Setting 1. bbPress New Forum ...
    • Backend Option Setting

      PeepSo LearnDash Tab Setting: Here you can enable or disable tabs related to user's courses, instructing courses and certificates. If the tab is enabled then it will show in PeepSo user Profile Section. Learndash Activity Setting: 1. Course ...