New xProfile Field Type – Checkbox Acceptance will be introduced in BuddyPress 8.0.0

The BuddyPress xProfile component gives you the power to create as many profile fields as you wish quickly and to organize these fields into groups of fields. An important step when creating a new profile field is to select the Field Type that best suits your need to display the information.

The Checkbox Acceptance field type is a new type of field we will introduce into our next major release (8.0.0). Thanks to it you’ll be able to easily create a new field to manage the Terms of Service of your site (which is often mandatory nowadays to follow compliance) or any other acceptance page (eg: code of conduct, good behavior rules, etc…). As it’s a profile field, it’s very easy to include it into your registration form to be sure to have your new members to agree to your linked acceptance page.

Adding a new field using the Checkbox Acceptance type.

When you’ll create a new xProfile field once you upgraded to BuddyPress 8.0.0, you will find a new field type option – Checkbox Acceptance.

Checkbox Acceptance field option

After selecting the Acceptance field, you can map your terms of service page to field options and include it into your registration form using the checkbox of the new Signup metabox (also introduced in 8.0.0).

Select your Terms of Service page to Checkbox Acceptance field

Save your profile field, and log out to preview the result on your registration page.

Checkbox Acceptance field view at register page.

It will be visible as in the above screenshot, mapped terms & condition page link on the register page with checkbox. Of course, new users will be able to click on the “Terms and conditions” link to aknowledge it.

Checkbox Acceptance field view for existing users.

Existing members can also agree to your acceptance page. Tell them to log in and visit their edit profile screen to submit their Acceptance from there. Once submitted, it will be a read-only field; members can not uncheck the value for the Acceptance field.

The acceptance field will only be visible to the logged-in member (viewing their self profile) and the admin. It will not be visible to members visiting any other one’s profile.

Checkbox Acceptance field view at own profile

Watch the demo!

The video below will show you how to create a new Acceptance field

Please read the full story about this new xProfile field type, head over to this ticket on our Trac environment.

#8-0-0, #xprofile

2 new xProfile Field types will be introduced in BuddyPress 8.0.0

The BuddyPress xProfile component gives you the power to easily create as many profile fields as you wish and to organize these fields into groups of fields. So far there was only one field which was linked to an existing WordPress user field : the base Name field. This field’s data is synchronized with the WordPress user display name (unless you opt out this synchronization from the BuddyPress Options Administration screen).

WP xProfile field types are arriving!

In BuddyPress 8.0.0, you’ll have the extra power to include other WordPress fields into the xProfile groups of fields. This time, unlike what we’re doing for the Name field, we are not duplicating and synchronizing field values between the WordPress user field tables (the wp_users & the wp_usermeta ones) and the BuddyPress xProfile data table). Instead we are directly using the WordPress user field values.

Creating these new field types, we’ve also improved our xProfile field API so that you can now have more control about the features your custom type of field can support.

/**
 * Custom xProfile field type.
 */
class Custom_XProfile_Field_Type extends BP_XProfile_Field_Type {

	/**
	 * This property enforces Field's default visibility.
	 */
	public $visibility = 'public';

	/**
	 * Supported features for the WordPress field type.
	 */
	public static $supported_features = array(
		'required'                => false,
		'do_autolink'             => false,
		'allow_custom_visibility' => false,
		'member_types'            => false,
	);
}

Using the static $supported_features property, you can disable the corresponding features meta boxes from the xProfile Administration Screen. The above example is showing the supported features by the WordPress fields : as defined by WordPress, these fields cannot be made required, cannot have their visibility changed for something different than public and cannot be restricted to a member type. Below are the values used by default for any xProfile field type.

A regular xProfile field can be made required, can be restricted to a specific member type, can be set to let members define the field data visibility and can be auto linked to a members search request about the field value.

1. wp-biography

The first type is specially designed to let you include the biographical information of the user into the group of xProfile fields of your choice.

2. wp-textbox

Using this type of field, you can insert the first name, the last name, the website URL and the potential WordPress User Contact Methods you added. Once you created your wp-textbox field, you’ll just need to use the advanced meta box below the field’s description textarea to select the information to include into the group of fields of your choice.

Watch the demo!

The video below will show you how to create a new field to add/edit the Member’s website URL and the Biographical information directly from their front-end profile.

If you want to read the full story about these new xProfile field types, head over to this ticket on our Trac environment.

#8-0-0, #wordpress, #xprofile