Skip to content

Commit

Permalink
FIX: Application will submit in private jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
nithinjohn22 committed Aug 16, 2023
1 parent e91b02f commit 4f42561
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/class-awsm-job-openings-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ public function insert_application() {

if ( $_SERVER['REQUEST_METHOD'] === 'POST' && ! empty( $_POST['action'] ) && $_POST['action'] === 'awsm_applicant_form_submission' ) {
$job_id = intval( $_POST['awsm_job_id'] );
$job_status = get_post_status( $job_id );
$applicant_name = sanitize_text_field( wp_unslash( $_POST['awsm_applicant_name'] ) );
$applicant_email = sanitize_email( wp_unslash( $_POST['awsm_applicant_email'] ) );
$applicant_phone = sanitize_text_field( wp_unslash( $_POST['awsm_applicant_phone'] ) );
Expand Down Expand Up @@ -451,6 +452,9 @@ public function insert_application() {
if ( empty( $attachment ) || ! isset( $attachment['error'] ) || $attachment['error'] > 0 ) {
$awsm_response['error'][] = esc_html__( 'Please select your cv/resume.', 'wp-job-openings' );
}
if ( $job_status !== 'publish' ) {
$awsm_response['error'][] = esc_html__( 'Error in submit your application.', 'wp-job-openings' );
}

/**
* Fires before job application submission
Expand Down

0 comments on commit 4f42561

Please sign in to comment.