Tutorial: Remove the Resume Preview Step

Note: All code examples on this site are provided for developer reference/guidance only and we cannot guarantee that they will always work as expected. Our support policy does not include assistance with modifying or debugging code from any code examples, and they may be changed or removed if we find they no longer work due to changes in our plugins.

To remove the Preview step during the resume submission process, add the following code to a plugin like Code Snippets:

<?php

/**
 * Remove the preview step when submitting resumes. Code goes in theme functions.php or custom plugin.
 * @param  array $steps
 * @return array
 */

add_filter( 'submit_resume_steps', function( $steps ) {
	unset( $steps['preview'] );
	return $steps;
} );

/**
 * Change button text.
 */
add_filter( 'submit_resume_form_submit_button_text', function() {
	return __( 'Submit Resume', 'wp-job-manager-resumes' );
} );

/**
 * Since we removed the preview step and it's handler, we need to manually publish resumes.
 * @param  int $resume_id
 */
add_action( 'resume_manager_update_resume_data', function( $resume_id ) {
	$resume = get_post( $resume_id );
	if ( in_array( $resume->post_status, array( 'preview', 'expired' ), true ) ) {
		// Reset expirey.
		delete_post_meta( $resume->ID, '_resume_expires' );

		// Update resume listing.
		$update_resume                  = array();
		$update_resume['ID']            = $resume->ID;
		$update_resume['post_status']   = get_option( 'resume_manager_submission_requires_approval' ) ? 'pending' : 'publish';
		$update_resume['post_date']     = current_time( 'mysql' );
		$update_resume['post_date_gmt'] = current_time( 'mysql', 1 );
		wp_update_post( $update_resume );
	}
} );

You may need to remove the first line from the code.

Basically this does a few things:

  1. Remove the preview step
  2. Change preview text to Submit Resume
  3. Manually publish resume (as the preview handler normally does this)
Resume Manager Documentation