Last active
June 14, 2023 20:31
-
-
Save tripflex/c11d5652a5707317577733d6b4d0de23 to your computer and use it in GitHub Desktop.
WP Job Manager Resumes redirect after Resume Submission (or show apply if creating for application) when using WP Job Manager Field Editor
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 | |
add_filter( 'submit_resume_steps', 'replace_resume_done_with_redirect' ); | |
function replace_resume_done_with_redirect( $steps ) { | |
$steps['done'] = array( | |
'priority' => 30, | |
'handler' => function() { | |
do_action( 'resume_manager_resume_submitted', WP_Resume_Manager_Form_Submit_Resume::instance()->get_resume_id() ); | |
$job_id = WP_Resume_Manager_Form_Submit_Resume::instance()->get_job_id(); | |
// Allow application | |
if ( ! empty( $job_id ) ) { | |
echo '<h3 class="applying_for">' . sprintf( __( 'Submit your application to the job "%s".', 'wp-job-manager-resumes' ), '<a href="' . get_permalink( $job_id ) . '">' . get_the_title( $job_id ) . '</a>' ) .'</h3>'; | |
echo do_shortcode( '[job_apply id="' . absint( $job_id ) . '"]' ); | |
} else { | |
$dashboard_id = get_option( 'resume_manager_candidate_dashboard_page_id' ); | |
if ( ! empty( $dashboard_id ) && wp_redirect( get_permalink( $dashboard_id ) ) ) { | |
exit; | |
} | |
} | |
}, | |
'view' => null, | |
); | |
return $steps; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that the echoed content renders before the wordpress header does!