<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: BuddyPress Profile Field Privacy</title>
		<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy</link>
		<description>Gravity Support Forums Topic: BuddyPress Profile Field Privacy</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 18:38:40 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/buddypress-profile-field-privacy" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-290533</link>
			<pubDate>Thu, 30 May 2013 20:04:07 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">290533@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Handling via priority support ticket.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-283886</link>
			<pubDate>Tue, 28 May 2013 14:11:08 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">283886@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Everyone gets answered in turn, with one of our developers each week focused on helping with advanced level support requests. There is no time limit I can give you beyond that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>marjwyatt on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-283750</link>
			<pubDate>Tue, 28 May 2013 13:04:41 +0000</pubDate>
			<dc:creator>marjwyatt</dc:creator>
			<guid isPermaLink="false">283750@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can you please tell me what that means to me with regard to a time frame?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-283488</link>
			<pubDate>Tue, 28 May 2013 11:09:36 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">283488@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'll bring this to the attention of the development team for you.  Thanks for your feedback.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>marjwyatt on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-282443</link>
			<pubDate>Tue, 28 May 2013 03:31:12 +0000</pubDate>
			<dc:creator>marjwyatt</dc:creator>
			<guid isPermaLink="false">282443@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I opened a support ticket on this very topic last Friday.   So, I guess this adds me to the list of people who desire this functionality for profile updates.&#60;/p&#62;
&#60;p&#62;Steve Holland has proposed a solution but it is unclear how I would do this inside my form.  Is he suggesting a method to modify the userregistration addon itself?  The latter seems more logical to me. &#60;/p&#62;
&#60;p&#62;This is the section of code found in userregistration.php that allows one to map buddypress xprofile fields to a gravity form:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;public static function get_buddypress_fields() {
    require_once(WP_PLUGIN_DIR . &#38;#39;/buddypress/bp-xprofile/bp-xprofile-classes.php&#38;#39;);
    // get BP field groups
    $groups = BP_XProfile_Group::get(array(&#38;#39;fetch_fields&#38;#39; =&#38;gt; true ));
    $buddypress_fields = array();
    $i = 0;
    foreach($groups as $group) {
        if(!is_array($group-&#38;gt;fields))
            continue;
        foreach($group-&#38;gt;fields as $field) {
            $buddypress_fields[$i][&#38;#39;name&#38;#39;] = $field-&#38;gt;name;
            $buddypress_fields[$i][&#38;#39;value&#38;#39;] = $field-&#38;gt;id;
            $i++;
        }
    }
    return $buddypress_fields;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Within the bp-xprofile-classes.php script, I've found this code:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;//front end display condition
if ( !empty( $fetch_visibility_level ) ) {
    $fields = self::fetch_visibility_level( $user_id, $fields );
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The associatiated functions related to fetch_visibility_level:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;/**
* Fetch the field visibility level for the fields returned by the query
*
* @since BuddyPress (1.6)
*
* @param int $user_id The profile owner&#38;#39;s user_id
* @param array $fields The database results returned by the get() query
* @return array $fields The database results, with field_visibility added
*/
function fetch_visibility_level( $user_id = 0, $fields = array() ) {
    // Get the user&#38;#39;s visibility level preferences
    $visibility_levels = bp_get_user_meta( $user_id, &#38;#39;bp_xprofile_visibility_levels&#38;#39;, true );
    // Get the admin-set preferences
    $admin_set_levels  = self::fetch_default_visibility_levels();
    foreach( (array) $fields as $key =&#38;gt; $field ) {
        // Does the admin allow this field to be customized?
        $allow_custom = empty( $admin_set_levels[$field-&#38;gt;id][&#38;#39;allow_custom&#38;#39;] ) &#124;&#124; &#38;#39;allowed&#38;#39; == $admin_set_levels[$field-&#38;gt;id][&#38;#39;allow_custom&#38;#39;];
        // Look to see if the user has set the visibility for this field
        if ( $allow_custom &#38;amp;&#38;amp; isset( $visibility_levels[$field-&#38;gt;id] ) ) {
            $field_visibility = $visibility_levels[$field-&#38;gt;id];
        // If no admin-set default is saved, fall back on a global default
        } else {
            $field_visibility = !empty( $admin_set_levels[$field-&#38;gt;id][&#38;#39;default&#38;#39;] ) ? $admin_set_levels[$field-&#38;gt;id][&#38;#39;default&#38;#39;] : apply_filters( &#38;#39;bp_xprofile_default_visibility_level&#38;#39;, &#38;#39;public&#38;#39; );
        }
        $fields[$key]-&#38;gt;visibility_level = $field_visibility;
    }
    return $fields;
}

/**
* Fetch the admin-set preferences for all fields
*
* @since BuddyPress (1.6)
*
* @return array $default_visibility_levels An array, keyed by field_id, of default
*   visibility level + allow_custom (whether the admin allows this field to be set by user)
*/
function fetch_default_visibility_levels() {
    global $wpdb, $bp;
    $levels = $wpdb-&#38;gt;get_results( &#38;quot;SELECT object_id, meta_key, meta_value FROM {$bp-&#38;gt;profile-&#38;gt;table_name_meta} WHERE object_type = &#38;#39;field&#38;#39; AND ( meta_key = &#38;#39;default_visibility&#38;#39; OR meta_key = &#38;#39;allow_custom_visibility&#38;#39; )&#38;quot; );

    // Arrange so that the field id is the key and the visibility level the value
    $default_visibility_levels = array();
    foreach( $levels as $level ) {
        if ( &#38;#39;default_visibility&#38;#39; == $level-&#38;gt;meta_key ) {
            $default_visibility_levels[$level-&#38;gt;object_id][&#38;#39;default&#38;#39;] = $level-&#38;gt;meta_value;
        } else if ( &#38;#39;allow_custom_visibility&#38;#39; == $level-&#38;gt;meta_key ) {
            $default_visibility_levels[$level-&#38;gt;object_id][&#38;#39;allow_custom&#38;#39;] = $level-&#38;gt;meta_value;
        }
    }
    return $default_visibility_levels;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;How to cobble all of this into a solution is the question...  &#60;/p&#62;
&#60;p&#62;My project is due for launch on June 30, 2013.  I want to know how/where to apply these functions to my profile update (Gravity) form or what would be the best method of customizing the userregistration.php to automate the inclusion of this functionality into the form on the front end, after the fiields have been mapped to their respective buddypress xprofile fields.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Elbnetz on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-130117</link>
			<pubDate>Thu, 24 Jan 2013 04:51:16 +0000</pubDate>
			<dc:creator>Elbnetz</dc:creator>
			<guid isPermaLink="false">130117@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That would be perfect!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Steve Holland on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-129818</link>
			<pubDate>Wed, 23 Jan 2013 21:37:13 +0000</pubDate>
			<dc:creator>Steve Holland</dc:creator>
			<guid isPermaLink="false">129818@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I do think it will become an issue if more people start using the plugin to update profiles. So a feature like this is something to think about in the near future, perhaps after the BETA release.&#60;/p&#62;
&#60;p&#62;I don't think it would be too difficult to implement, for example:&#60;/p&#62;
&#60;p&#62;When creating a feed you could have a checkbox 'enable privacy options', that could then check against the BuddyPress setting of the particular field and display the option(s) to the user on the frontend in the same way BuddyPress does. They simply have a line of text 'this field can be seen by anyone - change' and the 'change' link makes a dropdown box appear to alter the setting.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Elbnetz on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-129466</link>
			<pubDate>Wed, 23 Jan 2013 10:13:13 +0000</pubDate>
			<dc:creator>Elbnetz</dc:creator>
			<guid isPermaLink="false">129466@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi There I am the second to request that. In fact for BuddyPress the new brilliant feature would be useless without that option.&#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
T
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-121654</link>
			<pubDate>Mon, 14 Jan 2013 13:27:08 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">121654@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;We've added this to our list of requested features. Thus far, you are the only one who has asked.  After talking it over with the team, this would be fairly involved to add, so we will wait to see what sort of interest there is in it before attempting to tackle it.  Thank you for the suggestion.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Steve Holland on "BuddyPress Profile Field Privacy"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/buddypress-profile-field-privacy#post-115465</link>
			<pubDate>Sun, 06 Jan 2013 20:45:01 +0000</pubDate>
			<dc:creator>Steve Holland</dc:creator>
			<guid isPermaLink="false">115465@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks :)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
