/**
  * Constructor.
  */
 public function __construct()
 {
     add_action('wp', array($this, 'process'));
     $this->steps = (array) apply_filters('submit_resume_steps', array('submit' => array('name' => __('Submit Details', 'wp-job-manager-resumes'), 'view' => array($this, 'submit'), 'handler' => array($this, 'submit_handler'), 'priority' => 10), 'preview' => array('name' => __('Preview', 'wp-job-manager-resumes'), 'view' => array($this, 'preview'), 'handler' => array($this, 'preview_handler'), 'priority' => 20), 'done' => array('name' => __('Done', 'wp-job-manager-resumes'), 'view' => array($this, 'done'), 'handler' => '', 'priority' => 30)));
     uasort($this->steps, array($this, 'sort_by_priority'));
     // Get step/resume
     if (!empty($_REQUEST['step'])) {
         $this->step = is_numeric($_REQUEST['step']) ? max(absint($_REQUEST['step']), 0) : array_search($_REQUEST['step'], array_keys($this->steps));
     }
     $this->resume_id = !empty($_REQUEST['resume_id']) ? absint($_REQUEST['resume_id']) : 0;
     $this->job_id = !empty($_REQUEST['job_id']) ? absint($_REQUEST['job_id']) : 0;
     // Load resume details
     if ($this->resume_id) {
         $resume_status = get_post_status($this->resume_id);
         if ('expired' === $resume_status) {
             if (!resume_manager_user_can_edit_resume($this->resume_id)) {
                 $this->resume_id = 0;
                 $this->job_id = 0;
                 $this->step = 0;
             }
         } elseif (0 === $this->step && !in_array($resume_status, apply_filters('resume_manager_valid_submit_resume_statuses', array('preview'))) && empty($_POST['resume_application_submit_button'])) {
             $this->resume_id = 0;
             $this->job_id = 0;
             $this->step = 0;
         }
     }
 }
 /**
  * Init form
  */
 public static function init()
 {
     add_action('wp', array(__CLASS__, 'process'));
     self::$steps = (array) apply_filters('submit_resume_steps', array('submit' => array('name' => __('Submit Details', 'wp-job-manager-resumes'), 'view' => array(__CLASS__, 'submit'), 'handler' => array(__CLASS__, 'submit_handler'), 'priority' => 10), 'preview' => array('name' => __('Preview', 'wp-job-manager-resumes'), 'view' => array(__CLASS__, 'preview'), 'handler' => array(__CLASS__, 'preview_handler'), 'priority' => 20), 'done' => array('name' => __('Done', 'wp-job-manager-resumes'), 'view' => array(__CLASS__, 'done'), 'handler' => array(__CLASS__, 'application_handler'), 'priority' => 30), 'application_done' => array('name' => __('Application', 'wp-job-manager-resumes'), 'view' => array(__CLASS__, 'application_done'), 'priority' => 40)));
     uasort(self::$steps, array(__CLASS__, 'sort_by_priority'));
     // Get step/resume
     if (!empty($_REQUEST['step'])) {
         self::$step = is_numeric($_REQUEST['step']) ? max(absint($_REQUEST['step']), 0) : array_search($_REQUEST['step'], array_keys(self::$steps));
     }
     self::$resume_id = !empty($_REQUEST['resume_id']) ? absint($_REQUEST['resume_id']) : 0;
     self::$job_id = !empty($_REQUEST['job_id']) ? absint($_REQUEST['job_id']) : 0;
     if (self::$resume_id) {
         $resume_status = get_post_status(self::$resume_id);
         if ('expired' === $resume_status) {
             if (!resume_manager_user_can_edit_resume(self::$resume_id)) {
                 self::$resume_id = 0;
                 self::$job_id = 0;
                 self::$step = 0;
             }
         } elseif (!in_array($resume_status, apply_filters('resume_manager_valid_submit_resume_statuses', array('preview')))) {
             self::$resume_id = 0;
             self::$job_id = 0;
             self::$step = 0;
         }
     }
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     $this->resume_id = !empty($_REQUEST['resume_id']) ? absint($_REQUEST['resume_id']) : 0;
     if (!resume_manager_user_can_edit_resume($this->resume_id)) {
         $this->resume_id = 0;
     }
 }
 /**
  * Constructor
  */
 public static function init()
 {
     self::$resume_id = !empty($_REQUEST['resume_id']) ? absint($_REQUEST['resume_id']) : 0;
     if (!resume_manager_user_can_edit_resume(self::$resume_id)) {
         self::$resume_id = 0;
     }
 }