[buddypress-trac] [BuddyPress] #3695: Basic profile privacy

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Wed Feb 15 19:21:31 UTC 2012

#3695: Basic profile privacy
 Reporter:  boonebgorges            |       Owner:  cnorris23
     Type:  enhancement             |      Status:  accepted
 Priority:  normal                  |   Milestone:  Future Release
Component:  Core                    |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
Changes (by boonebgorges):

 * keywords:  needs-patch dev-feedback needs-ui => dev-feedback has-patch


 A client of mine wants this done, so I've taken another look.

 After some discussion with Paul and John, and taking some inspiration from
 cnorris23's original patch, I had another go at this. See 3695.002.patch.

 Some architectural decisions of note:
 - Profile privacy itself works by excluding certain fields from the
 BP_XProfile_Group::get() query. This is done inside the query method so
 that you can still pass in exclude_fields parameters to bp_has_profile()
 without accidentally bypassing privacy settings.
 - Everything is accomplished with, at most, a single additional query -
 for the displayed_user's usermeta bp_xprofile_privacy_levels.
 - There's basic infrastructure (in the form of filters) in place to extend
 with custom privacy settings. Register your privacy levels at
 bp_xprofile_get_privacy_levels, and control which fields are excluded from
 the query with bp_xprofile_get_hidden_fields_for_user.
 - Supported out of the box: Public, Logged In Users, My Friends
 - I wrote a small bit of javascript (with no-js fallback) for the profile
 editing section. I think the UI is passable.
 - If you are using a theme with a custom version of
 members/single/profile/edit.php, you will not have the privacy setting
 markup. That means that all of your profile fields will fall back to the
 admin-set default privacy setting for that field (set on the Dashboard
 panel where you edit individual profile fields); if no admin-defined
 default is provided, falls back on public. In other words, it degrades

 Would love to have a few sets of eyes on it. Thanks.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3695#comment:8>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list