Okay
  Print

How to add custom field to register form?

Hello Customers,

In some case you want to add more field to register form. Ex: Phone, Name...

Alright, You can follow this article to do that.

First you need use child theme Override Template in Plugin InJobto edit file register.php and register-popup.php in location wp-content\plugins\iwjob\templates

Then add this code to your child theme functions.php

add_action('iwj_register_process', function($uid){
    $user = IWJ_User::get_user($uid);
    $post_id = 0;
    if($user->is_employer()){
        $emp = $user->get_employer();
        $post_id = $emp->get_id();
    }
    if($user->is_candidate()){
        $cand = $user->get_candidate();
        $post_id = $cand->get_id();
    }
    
    if($post_id){
        //Also need check your custom field isset, should like this: if($post_id && isset($_POST['_iwj_phone'])){
        //Add you custom field name process here
        //Ex: update_post_meta($post_id, '_iwj_phone', sanitize_text_field($_POST['_iwj_phone']));
    }
});