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

buddypress-trac noreply at wordpress.org
Thu Mar 27 19:34:03 UTC 2014


#5220: Overhaul implementation of xprofile field types
------------------------------------------+---------------------
 Reporter:  DJPaul                        |       Owner:  DJPaul
     Type:  enhancement                   |      Status:  closed
 Priority:  normal                        |   Milestone:  2.0
Component:  XProfile                      |     Version:
 Severity:  normal                        |  Resolution:  fixed
 Keywords:  has-patch dev-feedback early  |
------------------------------------------+---------------------
Changes (by djpaul):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"8178"]:
 {{{
 #!CommitTicketReference repository="" revision="8178"
 xProfile: re-architecture profile field types and de-duplicate the
 templating and validation logic to make it easier for core and plugins to
 add new profile field types.

 Until now, it's been pretty hard to add new types of profile field to
 BuddyPress. There are a couple of plugins that do a good job, but
 BuddyPress makes it much harder than it should be because, historically,
 we've hardcoded values and checks in templates throughout the project. For
 example, profile field templating was duplicated in the registration
 template, the member/profile/edit template, in parts of the wp-admin
 xProfile screens, and in the new wp-admin extended profile editor.

 This change implements a new approach that creates a class for each
 profile field type; selectbox, textbox, textarea, and so on. They all
 share an abstract base class `BP_XProfile_Field_Type` which consolidates a
 lot of special behaviour that had been added to BuddyPress over the years
 (e.g. some fields accept null values, some accept multiple default
 values), and adds true field value validation. Unit tests are included.

 We've also implemented a new "Numbers" field type with these changes. It
 behaves much the same as a regular textbox field does, but it only accepts
 numbers.

 Fixes #5220 and #4694
 }}}

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


More information about the buddypress-trac mailing list