Duplicated register forms

Support MB User Profile Duplicated register formsResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19783
    Pogeun ParkPogeun Park
    Participant

    I set up a register form like below:
    [mb_user_profile_register id="sm_register"...] with meta boxes that I registered.
    It works but the shortcode outputs the default register form AND the one that I entered in the shorcode at the same time. What may cause this?

    #19801
    Long NguyenLong Nguyen
    Moderator

    Hi,

    By default, the shortcode [mb_user_profile_register] displays 4 base fields to register a user: Username, Email, Password and Confirm Password. If you want to create more user meta, you can add the meta box id to the shortcode.

    For more information, please follow the documentation.
    https://docs.metabox.io/extensions/mb-user-profile/#registration-form

    #19894
    Pogeun ParkPogeun Park
    Participant

    So there's no way I can put an extra field inline to those default fields. Right?

    #19914
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can use the filter hook rwmb_profile_register_fields to modify default fields of the register form. Follow my sample code

    add_filter( 'rwmb_profile_register_fields', 'add_more_register_fields' );
    
    function add_more_register_fields( $fields ) {
        $new_fields = [
            'phonenumber'  => [
                'name'     => __( 'Phone Number', 'mb-user-profile' ),
                'id'       => 'phonenumber',
                'type'     => 'number',
            ],
        ];
        $fields = array_merge( $fields, $new_fields );
        return $fields;
    }

    and here is the result https://share.getcloudapp.com/P8uEJzqr.

    For more information, please follow the documentation https://docs.metabox.io/extensions/mb-user-profile/#form-fields-filters.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.