[buddypress-trac] [BuddyPress] #5220: Overhaul implementation of xprofile field types

buddypress-trac noreply at wordpress.org
Sun Nov 3 17:23:38 UTC 2013


#5220: Overhaul implementation of xprofile field types
-------------------------+------------------------------
 Reporter:  DJPaul       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  XProfile     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------

Comment (by DJPaul):

 This weekend i've been iterating on some proof-of-concept patches that I'd
 written a couple of years ago. Find them on
 https://github.com/paulgibbs/BuddyPress/tree/xprofile-types, and I think
 [https://github.com/paulgibbs/BuddyPress/compare/buddypress:master
 ...xprofile-types this will give you a diff] of the changes against core
 trunk. The idea is to move all of BP's repeated "what type of field is
 this" conditional checks into a central place to make the code less
 fragile, and make it be tested easier, and to give BuddyPress a framework
 for custom profile field types.

 * The patch/branch implements a new "number" profile field type.
  * Support for checkbox, datebox, and radio boxes haven't been re-
 implemented yet.
 * A new class, `BP_XProfile_Field_Type`, describes the types of values
 that a field type accepts and handles validation, and handles template
 output for the "edit profile" screens.
  * There are unit tests which should prove the validation works, though I
 have not been able to run those because of recent difficulties on my
 laptop with phpunit.
 * The wp-admin Users > Profile Fields screen has been updated to support
 the new approach (the "Field Type" dropdown).
 * The front-end "save profile" logic has also been updated to support the
 new approach.

 Areas not identified or not listed haven't been changed yet, as I want to
 gather some feedback on this approach to see if it's popular, or if it
 helps guide us towards the best solution.

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


More information about the buddypress-trac mailing list