Skip to content

Instantly share code, notes, and snippets.

@tripflex
Last active June 14, 2023 20:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/c11d5652a5707317577733d6b4d0de23 to your computer and use it in GitHub Desktop.
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
<?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;
}
@majebry
Copy link

majebry commented Feb 11, 2019

It seems that the echoed content renders before the wordpress header does!

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