Registration: username as email, duplicated fields, avatar, visibility issue
Support › MB User Profile › Registration: username as email, duplicated fields, avatar, visibility issueResolved
- This topic has 15 replies, 7 voices, and was last updated 4 years, 1 month ago by
[email protected].
-
AuthorPosts
-
July 16, 2019 at 3:50 PM #15365
Mauro
ParticipantHello!
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:
- I want to use the e-mail address as username, and not allow the user to pick a username.
- I have a default-fields group that lists first name, last name and email address and this way the email address field is duplicated in the top section and in the following section of the form.
- I have a custom avatar and it's setup as a "single image" but I do not want the user to access the media manager. This should behave like the "image" field but with "multiple" attribute set to false.
- Once I'm logged in and I access the registration page, I see the form. I should see a message like in the login form: "you are already logged in".
Thanks!
Mauro.July 17, 2019 at 11:24 AM #15378Anh Tran
KeymasterHi Mauro,
This is a great feedback. I'll make the change and update the plugin soon.
November 19, 2019 at 6:12 PM #17003Mauro
ParticipantHi Anh, did you have a chance to address these things?
If so, how do I setup the form to hide the username?November 30, 2019 at 1:22 AM #17244Travis
ParticipantThis also sounds like what I'm looking for....was this ever implemented?
December 11, 2019 at 8:34 PM #17489Anh Tran
KeymasterHey guys,
I've just released a new version of MB User Profile with support for all of your requests:
- Added a new parameter
email_as_username
for the register shortcode, now you just need to addemail_as_username='true'
to your shortcode to let users use their email for usernames. - No duplicated fields are displayed in the WP admin area anymore. Feel free to add WP fields such as
first_name
,last_name
, etc. - For custom avatar, please just use the
image
field and set'max_file_uploads' => 1
. Users won't be able to add more files. - Messages are displayed properly now.
If you have any feedback, please let me know.
December 13, 2019 at 5:33 PM #17516Mauro
ParticipantThanks 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', ], ], ];
December 14, 2019 at 11:09 AM #17525Anh Tran
KeymasterHi 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.
December 15, 2019 at 3:17 PM #17529Mauro
ParticipantOK, 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?
December 16, 2019 at 4:20 PM #17535Anh Tran
Keymasterwould 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?
December 17, 2019 at 4:57 PM #17565Mauro
ParticipantUnfortunately, 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?
February 11, 2020 at 4:51 AM #18222mdiessner
Participantwould 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!
February 12, 2020 at 8:55 PM #18239Anh Tran
KeymasterWe're working on this. We've just finished that for the Frontend Submission extension and will do for User Profile next.
March 2, 2020 at 1:22 PM #18437mdiessner
ParticipantHi Anh,
Can you pls advise when this is implemented? I have the AIO plugin. Thanks, MartinApril 22, 2020 at 12:23 AM #19199Content Pilot
ParticipantThis 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.
August 26, 2020 at 2:37 AM #21465Johannes Gross
ParticipantI 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'));
-
AuthorPosts
- You must be logged in to reply to this topic.