Forked from bryceadams/gist:368d3396d72ca8e4b1da
Last active
September 20, 2017 22:17
-
-
Save danjjohnson/f1fa639ba5e5e44c4d161161b52a3bfa to your computer and use it in GitHub Desktop.
Add a field to resume submission form in WPJM Resume Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello danjjohnson,
How to format:
'type' => 'date',
Date is datepick of birthday show month and year dropdowns header