How to add Job Type Field
-
Hi. I hope you are doing well. I have added this code to enable mandatory field.
add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields');
function custom_submit_job_form_fields( $fields ) {
$fields['job']['job_location']['required'] = true;
$fields['job']['job_salary']['required'] = true;
$fields['company']['company_logo']['required'] = true;
return $fields;
}The code is working fine but to add job_type data field. The below given code is not working. Can you guide why is it not working.
add_filter( 'submit_job_form_fields', 'frontend_add_job_type_field', 20 );
function frontend_add_job_type_field( $fields ) {
$fields['job']['job_type'] = array(
'label' => __( 'Job Type', 'wp-job-manager' ),
'type' => 'select', // Dropdown field type
'required' => true,
'placeholder' => __( 'Choose job type…', 'wp-job-manager' ),
'priority' => 6,
'default' => 'full-time',
'options' => array(
'full-time' => __( 'Full Time', 'wp-job-manager' ),
'part-time' => __( 'Part Time', 'wp-job-manager' ),
'freelance' => __( 'Freelance', 'wp-job-manager' ),
),
);
return $fields;
}I have tried different codes and also used the one given below but it is not working. Maybe I am using the wrong hook name like frontend_add_job_type_field. Kindly help. Thanks
'label' => __( 'Job type', 'wp-job-manager' ),
'type' => $job_type,
'required' => true,
'placeholder' => __( 'Choose job type…', 'wp-job-manager' ),
'priority' => 4,
'default' => 'full-time',
'taxonomy' => \WP_Job_Manager_Post_Types::TAX_LISTING_TYPE,
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.