• Resolved dkanthal

    (@dkanthal)


    We are using the following code to remove the preview page and direct customers to a custom success page but when doing so it places jobs in preview on the back end instead of pending approval. Additionally, we aren’t able to preview the post without first publishing. How can we move all submitted jobs to pending approval? Happy Holidays!

    function custom_submit_job_steps( $steps ) {
    unset( $steps[‘preview’] );
    return $steps;
    }
    add_filter( ‘submit_job_steps’, ‘custom_submit_job_steps’ );
    function change_preview_text() {
    return __( ‘Submit Job’ );
    }
    add_filter( ‘submit_job_form_submit_button_text’, ‘change_preview_text’ );
    function done_publish_job( $job_id ) {
    $job = get_post( $job_id );
    if ( in_array( $job->post_status, array( ‘preview’, ‘expired’ ) ) ) {
    // Reset expirey
    delete_post_meta( $job->ID, ‘_job_expires’ );
    // Update job listing
    $update_job = array();
    $update_job[‘ID’] = $job->ID;
    $update_job[‘post_status’] = get_option( ‘job_manager_submission_requires_approval’ ) ? ‘pending’ : ‘publish’;
    $update_job[‘post_date’] = current_time( ‘mysql’ );
    $update_job[‘post_date_gmt’] = current_time( ‘mysql’, 1 );
    wp_update_post( $update_job );
    }
    }

    add_filter( ‘job_manager_job_submitted’, function() {
    if ( wp_redirect( ‘https://hrcolorado.com/thank-you/’ ) ) {
    exit;
    }
    }, 20 );

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Job Preview function not working after redirect’ is closed to new replies.