@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-buddypress-template-pack/>
  a sioc:Post ;
  dc:title "Profile field visibility" ;
  dcterms:identifier 154192 ;
  dc:modified "2026-11-10T11:51:38Z"^^xsd:dateTime ;
  dc:created "2026-11-10T11:39:02Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-buddypress-template-pack/profile-field-visibility/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-buddypress-template-pack/">LH BuddyPress Template Pack</a></li></ul>
<p class="wp-block-paragraph">On the profile edit and registration forms, the &#8220;This field can be seen by&#8221; line and its Change control appear only when the member can actually change that field&#8217;s visibility. Otherwise nothing is printed.</p>



<p class="wp-block-paragraph">The control shows only when all three are true:</p>



<ul class="wp-block-list">
<li>the field&#8217;s type supports custom visibility (<code>field_type_supports( 'allow_custom_visibility' )</code>). Types that declare it unsupported, such as LH Profile Page&#8217;s fields, whose values live in user meta, never get a control or label;</li>



<li>the field&#8217;s <code>allow_custom_visibility</code> xProfile setting is <code>allowed</code> (wp-admin: Users, Profile Fields, Visibility, &#8220;Allow members to override&#8221;); and</li>



<li>the current user has <code>bp_xprofile_change_field_visibility</code> for the field.</li>
</ul>



<p class="wp-block-paragraph">The pack never changes a field&#8217;s visibility. It stays in the field&#8217;s xProfile meta (<code>default_visibility</code>, plus each member&#8217;s own choice where overrides are allowed), which BuddyPress uses to hide the field from other people.</p>



<h2 class="wp-block-heading">Why the template checks the field</h2>



<p class="wp-block-paragraph">BP Legacy shows the Change control whenever <code>bp_current_user_can( 'bp_xprofile_change_field_visibility' )</code> 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 (<code>members/single/profile/edit.php</code> and <code>members/register.php</code>) read the field&#8217;s own setting first and drop the plain-text fallback; 0.1.47 added the field type check.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH BuddyPress Template Pack
On the profile edit and registration forms, the &#8220;This field can be seen by&#8221; line and its Change control appear only when the member can actually change that field&#8217;s visibility. Otherwise nothing is printed.



The control shows only when all three are true:




the field&#8217;s type supports custom visibility (field_type_supports( 'allow_custom_visibility' )). Types that declare it unsupported, such as LH Profile Page&#8217;s fields, whose values live in user meta, never get a control or label;



the field&#8217;s allow_custom_visibility xProfile setting is allowed (wp-admin: Users, Profile Fields, Visibility, &#8220;Allow members to override&#8221;); and



the current user has bp_xprofile_change_field_visibility for the field.




The pack never changes a field&#8217;s visibility. It stays in the field&#8217;s xProfile meta (default_visibility, plus each member&#8217;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&#8217;s own setting first and drop the plain-text fallback; 0.1.47 added the field type check.
""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1>, <https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261110t004500-profile-field-visibility> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261110t004500-profile-field-visibility> rdfs:seeAlso <https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261110t004500-profile-field-visibility&feed=lhrdf&format=turtle> .
