/** * Submit Step */ public function submit() { $job = get_post($this->job_id); if (empty($this->job_id) || $job->post_status !== 'publish' && !job_manager_user_can_edit_pending_submissions()) { echo wpautop(__('Invalid listing', 'wp-job-manager')); return; } $this->init_fields(); foreach ($this->fields as $group_key => $group_fields) { foreach ($group_fields as $key => $field) { if (!isset($this->fields[$group_key][$key]['value'])) { if ('job_title' === $key) { $this->fields[$group_key][$key]['value'] = $job->post_title; } elseif ('job_description' === $key) { $this->fields[$group_key][$key]['value'] = $job->post_content; } elseif ('company_logo' === $key) { $this->fields[$group_key][$key]['value'] = has_post_thumbnail($job->ID) ? get_post_thumbnail_id($job->ID) : get_post_meta($job->ID, '_' . $key, true); } elseif (!empty($field['taxonomy'])) { $this->fields[$group_key][$key]['value'] = wp_get_object_terms($job->ID, $field['taxonomy'], array('fields' => 'ids')); } else { $this->fields[$group_key][$key]['value'] = get_post_meta($job->ID, '_' . $key, true); } } } } $this->fields = apply_filters('submit_job_form_fields_get_job_data', $this->fields, $job); wp_enqueue_script('wp-job-manager-job-submission'); get_job_manager_template('job-submit.php', array('form' => $this->form_name, 'job_id' => $this->get_job_id(), 'action' => $this->get_action(), 'job_fields' => $this->get_fields('job'), 'company_fields' => $this->get_fields('company'), 'step' => $this->get_step(), 'submit_button_text' => __('Save changes', 'wp-job-manager'))); }
case 'publish': $actions['edit'] = array('label' => __('Edit', 'wp-job-manager'), 'nonce' => false); if (is_position_filled($job)) { $actions['mark_not_filled'] = array('label' => __('Mark not filled', 'wp-job-manager'), 'nonce' => true); } else { $actions['mark_filled'] = array('label' => __('Mark filled', 'wp-job-manager'), 'nonce' => true); } break; case 'expired': if (job_manager_get_permalink('submit_job_form')) { $actions['relist'] = array('label' => __('Relist', 'wp-job-manager'), 'nonce' => true); } break; case 'pending_payment': case 'pending': if (job_manager_user_can_edit_pending_submissions()) { $actions['edit'] = array('label' => __('Edit', 'wp-job-manager'), 'nonce' => false); } break; } $actions['delete'] = array('label' => __('Delete', 'wp-job-manager'), 'nonce' => true); $actions = apply_filters('job_manager_my_job_actions', $actions, $job); foreach ($actions as $action => $value) { $action_url = add_query_arg(array('action' => $action, 'job_id' => $job->ID)); if ($value['nonce']) { $action_url = wp_nonce_url($action_url, 'job_manager_my_job_actions'); } echo '<li><a href="' . esc_url($action_url) . '" class="job-dashboard-action-' . esc_attr($action) . '">' . esc_html($value['label']) . '</a></li>'; } ?> </ul>