buddypress/tests/testcases/xprofile
Paul Gibbs d44c1b1856 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

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8178 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2014-03-27 19:34:02 +00:00
..
activity.php Generate activity actions dynamically, instead of using static values stored in the database 2014-03-13 18:34:06 +00:00
cache.php Introduce metadata pre-fetching for xprofile objects 2014-02-17 19:42:03 +00:00
class-bp-xprofile-field-type.php 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. 2014-03-27 19:34:02 +00:00
class-bp-xprofile-field.php Unit Tests: remove copypasta from the testcase class name for XProfile/Field. 2014-03-01 00:24:51 +00:00
class-bp-xprofile-group.php Don't use fetch_default_visibility_levels() method in bp_has_profile() loop 2014-02-17 19:54:32 +00:00
class-bp-xprofile-profiledata.php Improve cache test for BP_XProfile_ProfileData::exists() 2014-03-03 01:48:51 +00:00
filters.php Migrate xprofilemeta functions to the WP metadata API 2014-02-13 03:50:39 +00:00
functions.php 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. 2014-03-27 19:34:02 +00:00