Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danjjohnson/f1fa639ba5e5e44c4d161161b52a3bfa to your computer and use it in GitHub Desktop.
Save danjjohnson/f1fa639ba5e5e44c4d161161b52a3bfa to your computer and use it in GitHub Desktop.
Add a field to resume submission form in WPJM Resume Manager
// Add field to admin
add_filter( 'resume_manager_resume_fields', 'wpjms_admin_resume_form_fields' );
function wpjms_admin_resume_form_fields( $fields ) {
$fields['_candidate_color'] = array(
'label' => __( 'Favourite Color', 'job_manager' ),
'type' => 'text',
'placeholder' => __( 'Blue', 'job_manager' ),
'description' => '',
'priority' => 1
);
return $fields;
}
// Add field to frontend
add_filter( 'submit_resume_form_fields', 'wpjms_frontend_resume_form_fields' );
function wpjms_frontend_resume_form_fields( $fields ) {
$fields['resume_fields']['candidate_color'] = array(
'label' => __( 'Favourite Color', 'job_manager' ),
'type' => 'text',
'required' => true,
'placeholder' => '',
'priority' => 1
);
return $fields;
}
// Add a line to the notifcation email with custom field
add_filter( 'apply_with_resume_email_message', 'wpjms_color_field_email_message', 10, 2 );
function wpjms_color_field_email_message( $message, $resume_id ) {
$message[] = "\n" . "Favourite Color: " . get_post_meta( $resume_id, '_candidate_color', true );
return $message;
}
@yumnihon
Copy link

Hello danjjohnson,

How to format:
'type' => 'date',
Date is datepick of birthday show month and year dropdowns header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment