Custom Fields
Re-Envisioned
Support MB User Profile Registration: username as email, duplicated fields, avatar, visibility issue

  • Creator
    Topic
  • #15365
    Resolved Mauro
    Participant

    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:

    1. I want to use the e-mail address as username, and not allow the user to pick a username.
    2. 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.
    3. 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.
    4. 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.

Viewing 10 replies - 1 through 10 (of 14 total)
  • Author
    Replies
  • #15378
    Anh Tran
    Keymaster

    Hi Mauro,

    This is a great feedback. I’ll make the change and update the plugin soon.

    #17003
    Mauro
    Participant

    Hi Anh, did you have a chance to address these things?
    If so, how do I setup the form to hide the username?

    #17244
    Travis
    Participant

    This also sounds like what I’m looking for….was this ever implemented?

    #17489
    Anh Tran
    Keymaster

    Hey guys,

    I’ve just released a new version of MB User Profile with support for all of your requests:

    1. Added a new parameter 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.
    2. No duplicated fields are displayed in the WP admin area anymore. Feel free to add WP fields such as first_name, last_name, etc.
    3. For custom avatar, please just use the image field and set 'max_file_uploads' => 1. Users won’t be able to add more files.
    4. Messages are displayed properly now.

    If you have any feedback, please let me know.

    #17516
    Mauro
    Participant

    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',
                    ],
                ],
            ];
    
    #17525
    Anh Tran
    Keymaster

    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.

    #17529
    Mauro
    Participant

    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?

    #17535
    Anh Tran
    Keymaster

    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?

    #17565
    Mauro
    Participant

    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?

    #18222
    mdiessner
    Participant

    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!

Viewing 10 replies - 1 through 10 (of 14 total)
  • You must be logged in to reply to this topic.