Okay
  Print

How to add/edit candidate, employer, job form?

Hello customer,

In some case, you want add/edit fields in candidate profile, employer profile or job form.

Here is article help you do this.

Firstly, you need implement this via child theme Override Template in Plugin InJob

1. Add/Edit field on candidate profile and employer

You also can add/edit/remove field by direct edit file wp-content\plugins\iwjob\templates\dashboard\profile\candidate-form.php

Then you need add code in functions.php on child theme to save your custom field added by you.

You can use action name candidate_update_profile for save your custom field ex:

add_action('candidate_update_profile', function($candidate){
    $custom_field = isset($_POST['your_custom_field_name'])?$_POST['your_custom_field_name']:'';
    update_post_meta($candidate->get_id(), 'your_cutsom_field_name', $custom_field);
});

Same like candidate if you want edit employer form by use action name employer_update_profile

2. Add/edit field on job form

Seem candidate and employer. You need edit two file

- add new: wp-content\plugins\iwjob\templates\dashboard\new-job\form.php

- edit form: \wp-content\plugins\iwjob\templates\dashboard\edit-job.php

And use action for save job 

add_action('iwj_update_job', 'update_job_custom_field');
add_action('iwj_add_new_job', 'update_job_custom_field');
function update_job_custom_field($post_id) {
    $custom_field = (isset($_POST['custom_field']) && $_POST['custom_field']) ? sanitize_text_field($_POST['custom_field']) : '';
    update_post_meta($post_id, 'custom_field', $custom_field);
}