*/ class Simple_Job_Board_Ajax { /** * Base directory of uploaded resume. * * @since 2.2.3 * @access private * @var Simple_Job_Board_Ajax $upload_basedir Store the base directory of uploaded resume. */ private $upload_basedir; /** * Base url of uploaded resume. * * @since 2.2.3 * @access private * @var Simple_Job_Board_Ajax $upload_baseurl Store the base url of uploaded resume. */ private $upload_baseurl; /** * Flag to indicate the error while uploading file * * @since 2.2.3 * @access private * @var Simple_Job_Board_Ajax $upload_file_error Store error indicator during file upload. */ private $upload_file_error_indicator; /** * Uploaded file error message * * @since 2.2.3 * @access private * @var Simple_Job_Board_Ajax $upload_file_error Store error message of file upload. */ private $upload_file_error = array(); /** * The name of uploaded file * * @since 2.2.3 * @access private * @var Simple_Job_Board_Ajax $upload_file_name Store the name of uploaded file. */ private $upload_file_name = array(); /** * Constructor */ public function __construct() { $this->upload_file_error_indicator = 0; // Hook - Entertain Applicant Request From Job Apply Form add_action( 'wp_ajax_nopriv_process_applicant_form', array($this, 'process_applicant_form') ); add_action( 'wp_ajax_process_applicant_form', array($this, 'process_applicant_form') ); // Hook - Uploaded Resume Validation add_action( 'sjb_uploaded_resume_validation', array($this, 'uploaded_resume_validation') ); } /** * Entertain Applicant Request From Job Apply Form * * @access public * @return void */ public function process_applicant_form() { check_ajax_referer( 'jobpost_security_nonce', 'wp_nonce' ); /** * Fires on job submission * * @since 2.2.3 */ do_action('sjb_uploaded_resume_validation'); if ( 1 == $this->upload_file_error_indicator ) { $errors = '