-
-
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
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_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