Hello how can i make my custom field appear on user registration
Support › MB User Profile › Hello how can i make my custom field appear on user registrationResolved
- This topic has 7 replies, 3 voices, and was last updated 2 years, 8 months ago by
13Garth.
-
AuthorPosts
-
March 23, 2022 at 12:05 AM #35217
[email protected]
ParticipantHello,
After creating custom fields.
Where can i put this php so i can get it to appear on my registration form ?
https://boost.my.id/wp-login.php?action=registerI tried to add it using code snippet plugin but none seems to appear on registration form
Thank you
Joie<?php add_filter( 'rwmb_meta_boxes', 'ficid_add_kontak' ); function ficid_add_kontak( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Kontak', 'ficid' ), 'id' => 'kontak', 'type' => 'user', 'fields' => [ [ 'name' => __( 'WhatsApp', 'ficid' ), 'id' => $prefix . 'whatsapp', 'type' => 'tel', 'desc' => __( 'Masukkan angka saja, Masukan 87876565 jika nomor HP anda 087876565', 'ficid' ), 'placeholder' => 87654321, 'required' => true, 'prepend' => 62, 'admin_columns' => [ 'position' => 'after title', 'title' => 'Whatsapp', ], ], [ 'type' => 'heading', 'name' => __( 'Alamat', 'ficid' ), ], [ 'name' => __( 'Jalan / Unit', 'ficid' ), 'id' => $prefix . 'alamat_jalan_unit', 'type' => 'text', ], [ 'name' => __( 'Provinsi', 'ficid' ), 'id' => $prefix . 'alamat_provinsi', 'type' => 'autocomplete', 'options' => [ 'jakarta' => __( 'Jakarta', 'ficid' ), 'jawa-timur' => __( 'Jawa Timur', 'ficid' ), 'papua' => __( 'Papua', 'ficid' ), 'sumatera-utara' => __( 'Sumatera Utara', 'ficid' ), ], ], [ 'name' => __( 'Kota / Kabupaten', 'ficid' ), 'id' => $prefix . 'alamat_kota_kabupaten', 'type' => 'autocomplete', 'options' => [ 'kota-jakarta-barat' => __( 'Kota Jakarta Barat', 'ficid' ), 'kota-jakarta-pusat' => __( 'Kota Jakarta Pusat', 'ficid' ), 'kota-mojokerto' => __( 'Kota Mojokerto', 'ficid' ), 'kab-mojokerto' => __( 'Kab Mojokerto', 'ficid' ), ], ], ], ]; return $meta_boxes; }
March 23, 2022 at 5:45 PM #35237Long Nguyen
ModeratorHi,
You can add the registration shortcode to a regular page to display the registration form and custom fields instead of the default registration form of WordPress
[mb_user_profile_register id="kontak"]
Refer to this documentation https://docs.metabox.io/extensions/mb-user-profile/
March 24, 2022 at 9:10 AM #35248[email protected]
ParticipantHello Thank you for your help.
I added the shortcode,
But my field is not styled correctlyUrl is : https://boost.my.id
Could you please help so that :
1. The text 62 is not wrapped
2. The text below the whatsapp field is smallerThank you
JoieMarch 24, 2022 at 12:19 PM #35249Long Nguyen
ModeratorHi,
1. Please use this custom CSS code in Appearance > Customize > Additional CSS, to fix the issue with the prepend text. I will inform the development team to fix this issue in the next update.
span.rwmb-input-group-text { width: 10%; justify-content: center; }
2. The font size of the description text below the WhatsApp field is controlled by your theme style. You can try to contact theme support to ask to change the font size of this text.
April 1, 2022 at 11:41 PM #35413[email protected]
ParticipantWhat if i want the custom field phone to display in the default WordPress registration form at wp-login, Is that possible ?
Do i need to add php snippet for thatI mean without using a new registration page
Thank you
JoieApril 2, 2022 at 10:20 AM #35418[email protected]
ParticipantHello please ignore the above request to use wp-login.
I think i will use [mb_user_profile_register] shortcode.Another question below,
I have custom user field group "user_kontak" consists of theses fields:
custom "user_kontak_whatsapp",
default "user_email",
custom "user_kontak_street"I tried : [mb_user_profile_register id="user_kontak"]
here what displayed, the email is displayed twice.
https://cln.sh/38xaA0out of that "user_kontak" field group I just want to use only user_kontak_whatsapp in addtion to the defaul user field registration form
So ideally my registration form will look like :
Email
Password
Confirm password
WhatsappDo i need to create a separate field group just to contain the one same field id "user_kontak_whatsapp" ?
Thank you
JoieApril 4, 2022 at 10:30 AM #35441Long Nguyen
ModeratorHi,
That is the default fields of the registration form, you can create other fields to add to the registration form, no need to add them twice.
If you want to customize the default fields, please use the filter hook
rwmb_profile_register_fields
. Refer to this topic https://support.metabox.io/topic/mb_user_profile_register-autocompletenew-password/#post-27210August 15, 2022 at 4:22 AM #3749713Garth
ParticipantTo fix styling for MB Labels use this in your style.css
.rwmb-label {
display: contents;
} -
AuthorPosts
- You must be logged in to reply to this topic.