Skip to content

Instantly share code, notes, and snippets.

Created February 1, 2016 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2822fbf9658288cbafcd to your computer and use it in GitHub Desktop.
Save anonymous/2822fbf9658288cbafcd to your computer and use it in GitHub Desktop.
/**
* Remove the preview step. Code goes in theme functions.php or custom plugin.
* @param array $steps
* @return array
*/
function wpjm_remove_resume_preview_step( $steps ) {
unset( $steps['preview'] );
return $steps;
}
add_filter( 'submit_resume_steps', 'wpjm_remove_resume_preview_step' );
/**
* Change button text (won't work until v1.16.2)
*/
function wpjm_change_resume_button_text() {
return __( 'Submit Resume' );
}
add_filter( 'submit_resume_form_submit_button_text', 'wpjm_change_resume_button_text' );
/**
* Since we removed the preview step and it's handler, we need to manually publish resumes
* @param int $resume_id
*/
function wpjm_manually_publish_resume( $resume_id ) {
$resume = get_post( $resume_id );
if ( in_array( $resume->post_status, array( 'preview', 'expired' ) ) ) {
// Reset expirey
delete_post_meta( $resume->ID, '_resume_expires' );
// Update resume listing
$update_resume = array();
$update_resume['ID'] = $resume->ID;
$update_resume['post_status'] = apply_filters( 'submit_resume_post_status', get_option( 'resume_manager_submission_requires_approval' ) ? 'pending' : 'publish', $resume );
wp_update_post( $update_resume );
}
}
add_action( 'resume_manager_resume_submitted', 'wpjm_manually_publish_resume' );
@Jeppeskovsgaard
Copy link

This works fine. After adding the code though, the resumes end up in the preview status tab, with the status set to "inactive", instead of the pending tab. How do I make the resumes show up in pending with the proper pending status type?

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