Tagged: custom field for register form
3 years, 8 months ago #41475
I want to add custom field to register form.
Name Surname (for company's user)
can you help me please...?3 years, 8 months ago #41583
Wish you a nice day.
At this moment, We do not support this feature in Jobmonter theme
ThuyNT3 years, 8 months ago #41649
Thanks but i haveto add some field
if you are tell me i can add to code files!3 years, 8 months ago #41716
Kan NguyenCustomerTopics: 1
I can't give you the full code, I can only give you instruction and you have to do the rest by yourself. I assume you have knowledge about PHP and WordPress programing.
First, it seems you want to add custom fields to automatically add company info, it'll need more code than usual because, in our theme, we don't create company right after registration.
1. To add the fields, first, you have to edit file /noo-jobmonster/layouts/register-form.php it's a form for registration and you can add your fields there, like:
<div class="form-group row"> <label for="company_name" class="col-sm-3 control-label"><?php _e('Company Name','noo')?></label> <div class="col-sm-9"> <input type="email" class="form-control" id="company_name" name="company_name" required placeholder="<?php _e('Company Name','noo')?>"> </div> </div>
You can also use the action hook 'noo_register_form' to add your fields.
2. To process the submitted data, you will have to edit file /noo-jobmonster/framework/admin/noo_form_handler.php, function _register_new_user ( again, there's an action hook 'noo_new_user_registered' for you. )
- You'll have to use the $_POST variable to get the submitted data.
- To add a new company, you can use function wp_insert_post:
$company_id = wp_insert_post( array( 'post_title' => $_POST['company_name'], 'post_type' => 'noo_company' ) );
- But please remember to assign the new company to the company user:
update_user_meta($user_id, 'employer_company', $company_id);
$user_id is the id of the new user and $company_id is the result of above wp_insert_post statement.
3. To add other fields to the company, you can use function update_post_meta to add value to the company ( $company_id ) or update_user_meta to add value to the user ( $user_id ). But becuase our theme doesn't know your fields, you'll have to add another code to display it where you want ( see file/noo-jobmonster/layouts/noo_company-info.php )
I hope that it's clear enough.
Kan Nguyen3 years, 8 months ago #41805
Thanks for your patience.
I'm learnin PHP about four mount's.
I will try customize the register form.
Best regards1 year, 5 months ago #1056251
Hi Kan, Your advice was very helpful.
I could add custom fields and they are working fine.
Many thanks1 year, 5 months ago #1056259
Tracy BuiNooThemeTopics: 0
Posts: 8615This reply has been marked as private.7 months, 4 weeks ago #1072312
Would be great to have this feature available in the Settings. It makes sence that on registration you offer your name & the Company Name. Otherwise the user decides what to enter, some enter their name, some enter the company name.7 months, 3 weeks ago #1072496
Tracy BuiNooThemeTopics: 0
Thanks for contacting us.
Currently, we are available the customer service so if you want to add more fields to Login/Register form. We can discuss with our developer and they can help you with an extra fee.
Please consider, then feedback us.
NooTheme6 months, 2 weeks ago #1075011
would like to add Phone Number field on register window (Mandatory).
You must be logged in and have valid license to reply to this topic.