BuddyPress Xprofile Member Type Field plugin allows site admins to use BuddyPress member type as profile field. It lest user choose their member type and the updates user's member type based on their selection of the member type in the profile field.
Features:-
- Uses Member Type As Xprofile Field
- Updates & syncs user's member type with the xprofile field and vice versa
- Works with Non Editable Profile field plugin if you don't want to allow users to modify their member type after registration.
- Searchable Member type fields(added in 1.0.1) when using BP Profile Search plugin, thanks to Andrea.
- Do you need a more powerful
The current version shows the registered member types as a select element(dropdown).
Screenshot:-
Add New Profile Field screen:-
Registration page Member Type Field:-
Edit profile page member type field ( If you are not using Non Editable Profile field plugin):-
Using as Radio Field:-
With version 1.0.2 and above, you can put the following code in your bp-custom.php to make it work as radio instead of the select box.
add_filter( 'bd_xprofile_field_type_membertype_as_radio', '__return_true');
Limit Allowed type to certain member types:-
/** * Filter and limit member types to the following. * * @param array $allowed_options an array of member_type => Member type labels * * @param $registered_types array of member type objects as returned by bp_get_member_types() */ function buddydev_filter_allowed_xprofile_member_types( $allowed_options, $registered_types ) { // say we have 3 registered member types, 'student', 'teacher' and 'staff' // And we only want to allow users to select between 'student' or 'teacher' $allowed_options = array( 'student' => 'Student', 'teacher' => 'Teacher' ); return $allowed_options; } add_filter( 'bp_xprofile_member_type_field_allowed_types', 'buddydev_filter_allowed_xprofile_member_types', 10, 2 );