Registration: username as email, duplicated fields, avatar, visibility issue

Support MB User Profile Registration: username as email, duplicated fields, avatar, visibility issueResolved

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #15365
    MauroMauro
    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.

    #15378
    Anh TranAnh Tran
    Keymaster

    Hi Mauro,

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

    #17003
    MauroMauro
    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
    TravisTravis
    Participant

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

    #17489
    Anh TranAnh 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
    MauroMauro
    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 TranAnh 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
    MauroMauro
    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 TranAnh 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
    MauroMauro
    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
    mdiessnermdiessner
    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!

    #18239
    Anh TranAnh Tran
    Keymaster

    We're working on this. We've just finished that for the Frontend Submission extension and will do for User Profile next.

    #18437
    mdiessnermdiessner
    Participant

    Hi Anh,
    Can you pls advise when this is implemented? I have the AIO plugin. Thanks, Martin

    #19199
    Content PilotContent Pilot
    Participant

    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.

    #21465
    Johannes GrossJohannes Gross
    Participant

    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'));
Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.