User profile fields not showing in the dashboard
Support › MB User Profile › User profile fields not showing in the dashboardResolved
- This topic has 2 replies, 2 voices, and was last updated 4 years, 11 months ago by
ossama saeed.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
May 18, 2020 at 6:53 PM #19662
ossama saeed
ParticipantHi,
Thanks for the great plugin and for your great support team.
I`v created a user profile form and it works fine in the front-end. but the form fields not showing in the admin dashboard.
I`m using Meta Box version 5.3.0 & MB User Profile Version 1.7.0
here is my code:
function register_user_profile_fields($meta_boxes) { $prefix = 'user_profile_'; // fields $meta_boxes[] = [ 'id' => $prefix . 'edit_form_basic', 'title' => 'Your basic information', 'type' => 'user', 'fields' => [ // Email Address Field. [ 'id' => 'user_email', 'type' => 'email', 'name' => 'Email address', 'readonly' => ( wp_get_current_user()->user_email ) ? true : false, 'required' => true ], // Job Title Field. [ 'name' => 'Title (position)', 'id' => 'user_job_title', 'type' => 'text', 'required' => true ], // First Name Field. [ 'id' => 'first_name', 'name' => 'First name', 'type' => 'text', 'required' => true ], // Last Name Field. [ 'id' => 'last_name', 'name' => 'Last name', 'type' => 'text', ], // Phone Number Field. [ 'name' => 'Phone Number', 'id' => 'user_mobile', 'type' => 'tel', 'required' => true, ], // Gender Field [ 'name' => 'Gender', 'id' => 'user_gender', 'type' => 'radio', 'options' => [ 'Male' => 'male', 'Female' => 'Female', ], ], return $meta_boxes; } add_action( 'rwmb_meta_boxes', 'register_user_profile_fields',2, 1);
and here is my shortcode
echo do_shortcode( '[mb_user_profile_info id="user_profile_edit_form_basic" form_id = "edit_user_profile" submit_button="Save" confirmation="Your information has been successfully submitted. Thank you." ]' );
Thanks in advanced,
May 18, 2020 at 9:58 PM #19666Long Nguyen
ModeratorHi,
Your code is missing close bracket
]
, please try again with this onefunction register_user_profile_fields($meta_boxes) { $prefix = 'user_profile_'; // fields $meta_boxes[] = [ 'id' => $prefix . 'edit_form_basic', 'title' => 'Your basic information', 'type' => 'user', 'fields' => [ // Email Address Field. [ 'id' => 'user_email', 'type' => 'email', 'name' => 'Email address', 'readonly' => ( wp_get_current_user()->user_email ) ? true : false, 'required' => true ], // Job Title Field. [ 'name' => 'Title (position)', 'id' => 'user_job_title', 'type' => 'text', 'required' => true ], // First Name Field. [ 'id' => 'first_name', 'name' => 'First name', 'type' => 'text', 'required' => true ], // Last Name Field. [ 'id' => 'last_name', 'name' => 'Last name', 'type' => 'text', ], // Phone Number Field. [ 'name' => 'Phone Number', 'id' => 'user_mobile', 'type' => 'tel', 'required' => true, ], // Gender Field [ 'name' => 'Gender', 'id' => 'user_gender', 'type' => 'radio', 'options' => [ 'Male' => 'male', 'Female' => 'Female', ], ], ], ]; return $meta_boxes; } add_action( 'rwmb_meta_boxes', 'register_user_profile_fields',2, 1);
it works well on both front end and backend, see my screenshots
https://share.getcloudapp.com/8LujW9r4
https://share.getcloudapp.com/GGukb42LMay 18, 2020 at 10:21 PM #19667ossama saeed
ParticipantHi Long,
Thank for your fast reply, I solved the issue it was not related to Meta Box at all, Sorry for the inconvenience.
Thank you,
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.