Custom Fields
Re-Envisioned
Support MB User Profile Duplicated register forms

  • Creator
    Topic
  • #19783
    Resolved Pogeun 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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #19801
    Long 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 Park
    Participant

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

    #19914
    Long 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 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.