Support Forum
Support › MB User Profile › Registration: username as email, duplicated fields, avatar, visibility issueResolved
Hello!
In the registration form that gets created through the shortcode
[mb_user_profile_register id="meta-box-id" label_submit="Register" confirmation="Your account has been created successfully."]
I have the following issues:
Thanks!
Mauro.
Hi Mauro,
This is a great feedback. I'll make the change and update the plugin soon.
Hi Anh, did you have a chance to address these things?
If so, how do I setup the form to hide the username?
This also sounds like what I'm looking for....was this ever implemented?
Hey guys,
I've just released a new version of MB User Profile with support for all of your requests:
email_as_username
for the register shortcode, now you just need to add email_as_username='true'
to your shortcode to let users use their email for usernames.first_name
, last_name
, etc.image
field and set 'max_file_uploads' => 1
. Users won't be able to add more files.If you have any feedback, please let me know.
Thanks for this Anh!
The email as username flag works fine as far as I can tell.
Unfortunately I still see duplicated fields in the form generated in the shortcode for the registration form.
This is my shortcode:
[mb_user_profile_register form_id="profile-form" id="registration-fields" id_username="email" id_password="password1" id_password2="password2" label_submit="Register" confirmation="Your account has been created successfully." email_as_username="true"]
Am I doing something wrong?
Here is my meta box setup for this:
$meta_boxes[] = [
'title' => '',
'id' => 'registration-fields',
'type' => 'user', // NOTICE THIS
'fields' => [
[
'id' => 'first_name', // THIS
'name' => 'First Name',
'type' => 'text',
],
[
'id' => 'last_name', // THIS
'name' => 'Last Name',
'type' => 'text',
],
[
'id' => 'email', // THIS
'name' => 'E-Mail',
'type' => 'email',
],
[
'id' => 'password1', // THIS
'name' => 'Password',
'type' => 'password',
],
[
'id' => 'password2', // THIS
'name' => 'Confirm Password',
'type' => 'password',
],
[
'id' => 'gender', // THIS
'name' => 'Gender',
'type' => 'radio',
'options' => array('m'=>'M','f'=>'F'),
],
[
'id' => 'birthday', // THIS
'name' => 'Date of Birth',
'type' => 'date',
//'readonly' => true,
'js_options' => array(
'dateFormat' => 'dd-M-yy',
'changeYear' => true,
'yearRange' => "1930:2010"
),
'save_format' => 'Y-m-d',
],
[
'id' => 'country', // THIS
'name' => 'Country',
'type' => 'select_advanced',
'options' => $this->countries,
],
[
'id' => 'privacy', // THIS
'name' => 'Privacy Policy',
'type' => 'checkbox',
'desc' => 'I have read and agree to the <a href="/privacy" target="_blank" rel="noopener noreferrer">Privacy Policy</a>',
'required' => 'This field is required to complete registration',
],
],
];
Hi Mauro,
I think I misunderstood your point. The improvement I made is for removing duplicated fields from the back end.
I think in this case, you shouldn't add those email/password fields in the register form as it's already in the top of the form.
OK, that works, but I can't decide the order of the fields. Can live with it but would be nice to be able to put i.e. first name and last name above the email and password fields.
One more thing, can I hide the password field and have WP generate one and send it in email with the welcome message?
would be nice to be able to put i.e. first name and last name above the email and password fields.
I got it. I'm trying to make that easier for you to reorder the fields. Please wait.
One more thing, can I hide the password field and have WP generate one and send it in email with the welcome message?
Unfortunately, it's not possible. I guess you're tailoring the registration progress, aren't you?
Unfortunately, it’s not possible. I guess you’re tailoring the registration progress, aren’t you?
Yes, and in the past I did it with a fully custom plug-in.
Will probably use something else if they want further customisation of the process.
Please note: after update the calendar for the "date of birth" date field isn't showing up anymore. Is this just me or something broke on your side?
would be nice to be able to put i.e. first name and last name above the email and password fields.
I got it. I’m trying to make that easier for you to reorder the fields. Please wait.
Has this been done - I have the same issue that email/password/confirm come up first, then the other fields from custom fields including first_name and last_name. Thanks!
We're working on this. We've just finished that for the Frontend Submission extension and will do for User Profile next.
Hi Anh,
Can you pls advise when this is implemented? I have the AIO plugin. Thanks, Martin
This is what broke my website.
#4 from Mauro's original post. Hide the form if a user is already logged in. Seems logical.
I was using this user registration form so that admins could register authors. Meaning that an admin is logged in, as their admin account, then they browse to a frontend form to register a new user. I have this form setup with a post type creation form as a workflow for creating users attached as authors to a single post type object.
All I need is for the registration form to be exposed even if the user is logged in.
I was able to display the first_name and last_name field above the email address by using the following code:
function add_more_registration_fields($fields) {
$new_fields = [
'first_name' => [
'name' => 'First Name',
'id' => 'first_name',
'type' => 'text',
'required' => 1
],
'last_name' => [
'name' => 'Last Name',
'id' => 'last_name',
'type' => 'text',
'required' => 1
],
];
$fields = array_merge( $new_fields, $fields );
return $fields;
}
add_filter( 'rwmb_profile_register_fields', 'add_more_registration_fields'));