[buddypress-trac] [BuddyPress] #5317: Add xprofile field Vibility "Admin only"

buddypress-trac noreply at wordpress.org
Fri Jan 3 15:12:42 UTC 2014


#5317: Add xprofile field Vibility "Admin only"
-------------------------------------------------+-------------------------
 Reporter:  megainfo                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  XProfile                             |  Review
 Severity:  normal                               |     Version:  1.9.1
 Keywords:  has-patch 2nd-opinion reporter-      |  Resolution:
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by megainfo):

 My suggestion is to add new vibility levels called ""Admin only".

 '''Fields with "Admin only" vibility level are Viwed & Edited by
 administrators only.'''
 ie: Fields are hidden from all members except admins.


 "Admin only" fields can be used in 2 cases :

 - Certain profiles fields viewable & editable by admin only :
 In many cases, admin want create fields and make them visible & editable
 only for him. I think this new visibility level will give more flexibility
 to admins if he would manage confidential informations about members.


 - Can be useful in third party code or plugins :
 It's can be useful for code costumizator or plugins authors if they want
 create some extra fonctionality like manage levels or roles for members.
 I guess a lot of developers will found great utility to add this vibility
 level.


 I suggested to add filter for hiddens levels in the patch :

 {{{
 // filter the visibility levels
 return apply_filters( 'bp_xprofile_get_hidden_field_types_for_user',
 $hidden_levels, $displayed_user_id, $current_user_id );
 }}}

 i think this make bp-xprofile vibililty functionality extensible (ie.
 developers can add new vibility levels to $bp->profile->visibility_levels
 by using "bp_xprofile_get_visibility_levels" filter and they can extend
 the tests of visibility levels that should be hidden by calling the new
 filter "bp_xprofile_get_hidden_field_types_for_user".

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5317#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list