Digital Sovereignty for everyone

Profile field visibility

On the profile edit and registration forms, the “This field can be seen by” line and its Change control appear only when the member can actually change that field’s visibility. Otherwise nothing is printed.

The control shows only when all three are true:

  • the field’s type supports custom visibility (field_type_supports( 'allow_custom_visibility' )). Types that declare it unsupported, such as LH Profile Page’s fields, whose values live in user meta, never get a control or label;
  • the field’s allow_custom_visibility xProfile setting is allowed (wp-admin: Users, Profile Fields, Visibility, “Allow members to override”); and
  • the current user has bp_xprofile_change_field_visibility for the field.

The pack never changes a field’s visibility. It stays in the field’s xProfile meta (default_visibility, plus each member’s own choice where overrides are allowed), which BuddyPress uses to hide the field from other people.

Why the template checks the field

BP Legacy shows the Change control whenever bp_current_user_can( 'bp_xprofile_change_field_visibility' ) is true, and otherwise still prints the visibility level as plain text. On LocalHero that check was found to allow the control even for fields set to enforce their visibility. From 0.1.46 the templates (members/single/profile/edit.php and members/register.php) read the field’s own setting first and drop the plain-text fallback; 0.1.47 added the field type check.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.