Last active
December 30, 2020 20:56
-
-
Save jom/b9ea165213e38e4044dfd7c954a189dc to your computer and use it in GitHub Desktop.
Remove Resume Preview Step
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
<?php | |
/** | |
* Remove the preview step when submitting resumes. Code goes in theme functions.php or custom plugin. | |
* @param array $steps | |
* @return array | |
*/ | |
add_filter( 'submit_resume_steps', function( $steps ) { | |
unset( $steps['preview'] ); | |
return $steps; | |
} ); | |
/** | |
* Change button text. | |
*/ | |
add_filter( 'submit_resume_form_submit_button_text', function() { | |
return __( 'Submit Resume', 'wp-job-manager-resumes' ); | |
} ); | |
/** | |
* Since we removed the preview step and it's handler, we need to manually publish resumes. | |
* @param int $resume_id | |
*/ | |
add_action( 'resume_manager_update_resume_data', function( $resume_id ) { | |
$resume = get_post( $resume_id ); | |
if ( in_array( $resume->post_status, array( 'preview', 'expired' ), true ) ) { | |
// Reset expirey. | |
delete_post_meta( $resume->ID, '_resume_expires' ); | |
// Update resume listing. | |
$update_resume = array(); | |
$update_resume['ID'] = $resume->ID; | |
$update_resume['post_status'] = get_option( 'resume_manager_submission_requires_approval' ) ? 'pending' : 'publish'; | |
$update_resume['post_date'] = current_time( 'mysql' ); | |
$update_resume['post_date_gmt'] = current_time( 'mysql', 1 ); | |
wp_update_post( $update_resume ); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jom you are correct in that it's a couple of fields under an form object with the class "apply_with_resume"; it only appears for a logged-in user, though.
On this particular site, we're not requiring account creation. So when a non-logged-in user completes the application, those users actually get redirected back to the resume submission page without seeing the submissions message fields. It's not until attempting subsequent submissions that non-logged-in users can see the submission message fields. (I'm assuming based on session cookies) However, those non-logged-in users aren't allowed to resubmit. I suspect this is a bit of an edge case, especially in terms of the site I'm working with. It is a little confusing, though, and I'm concerned that this will cause problems in the however-unlikely event my client posts multiple positions that a single applicant would be interested in.
Ultimately, regardless of the above circumstances I'd like to see the option of directing resume ubmitters to an entirely different "Thank You" page after they've completed the application process, so we could tie those visits to goal conversions in Google Analytics.