Skip to content

Instantly share code, notes, and snippets.

@tripflex
Forked from davoraltman/redirectJD
Last active September 7, 2018 15:05
Show Gist options
  • Save tripflex/258419a18d8cbc556c26f09400b90d4d to your computer and use it in GitHub Desktop.
Save tripflex/258419a18d8cbc556c26f09400b90d4d to your computer and use it in GitHub Desktop.
Redirect to Job Dashboard after job submission when using WP Job Manager Field Editor
<?php
add_filter( 'submit_job_steps', 'replace_done_with_redirect' );
function replace_done_with_redirect( $steps ) {
$steps['done'] = array(
'priority' => 30,
'handler' => function() {
do_action( 'job_manager_job_submitted', WP_Job_Manager_Form_Submit_Job::instance()->get_job_id() );
if ( wp_redirect( job_manager_get_permalink( 'job_dashboard' ) ) ) {
exit;
}
},
'view' => null,
);
return $steps;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment