Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 10 years ago

Last modified 10 years ago

#4694 closed enhancement (fixed)

Profile field type: Number

Reported by: sooskriszta's profile sooskriszta Owned by: djpaul's profile DJPaul
Milestone: 2.0 Priority: normal
Severity: normal Version:
Component: Extended Profile Keywords:
Cc: vivek@…

Description

Would be great to have a profile field of the type Number.

The input would be a textbox, but with 5-8 character width, and validation to ensure input is integer.

This could be used for stuff like
Height in cm
Years of experience
etc

Change History (9)

#2 @DJPaul
12 years ago

  • Milestone changed from Awaiting Review to Future Release

#3 @sooskriszta
11 years ago

1.8?
(Please, please...)

#4 @DJPaul
11 years ago

Types of profile fields is a big project and beyond scope for 1.8.

#5 @sooskriszta
11 years ago

Seems we now have a plugin that adds field types...
http://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/
Consider merging into core?

#6 @sooskriszta
11 years ago

  • Cc vivek@… added

#7 @DJPaul
10 years ago

  • Milestone changed from Future Release to 2.0
  • Owner set to DJPaul
  • Status changed from new to assigned

#8 @djpaul
10 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 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

This ticket was mentioned in IRC in #buddypress-dev by OC2PS. View the logs.


10 years ago

Note: See TracTickets for help on using tickets.