| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?php if (!defined('ABSPATH')) { exit; } // Exit if accessed directly
- /**
- * Simple_Job_Board_Applicants Class
- *
- * This is used to display the applicant details in WP admin. It also display the
- * applicant data & resume.
- *
- * @link https://wordpress.org/plugins/simple-job-board
- * @since 1.0.0
- * @since 2.3.0 Added "sjb_resume_link_after" and "sjb_applicant_name" hooks.
- *
- * @package Simple_Job_Board
- * @subpackage Simple_Job_Board/includes
- * @author PressTigers <support@presstigers.com>
- */
- class Simple_Job_Board_Applicants {
- /**
- * Initialize the class and set its properties.
- *
- * @since 1.0.0
- */
- public function __construct() {
- // Hook -> Job Applicants Data
- add_action('edit_form_after_title', array($this, 'jobpost_applicants_detail_page_content'));
- }
- /**
- * Create Detail Page for Applicants
- *
- * @since 1.0.0
- */
- public function jobpost_applicants_detail_page_content() {
- global $post;
- if (!empty($post) and 'jobpost_applicants' === $post->post_type):
- $keys = get_post_custom_keys($post->ID);
- /**
- * Fires before displaying the applicant details
- *
- * @since 2.2.0
- */
- do_action('sjb_applicants_details_before', $post->ID);
- ?>
- <div class="wrap"><div id="icon-tools" class="icon32"></div>
- <?php
- // Applicant Name
- if (NULL != $keys):
- foreach ($keys as $key) {
- if ('jobapp_' === substr($key, 0, 7)) {
- $place = strpos($key, 'name');
- if (!empty($place)) {
- $applicant_name = get_post_meta($post->ID, $key, TRUE);
- $applicant_name = apply_filters('sjb_applicant_name', $applicant_name);
- break;
- }
- }
- }
- endif;
- ?>
- <!-- Applicant's Name & Resume in Admin Area -->
- <h3>
- <?php
- echo isset($applicant_name) ? $applicant_name : '';
- // Applicant Resume
- if (in_array('resume', $keys) && '/' != get_post_meta($post->ID, 'resume', TRUE)):
- $resume = ' <small><a href="' . esc_url(get_admin_url() . 'post.php?post=' . intval($post->ID) . '&action=edit&resume_id=' . intval($post->ID)) . '" rel="nofollow">' . esc_html__('Resume', 'simple-job-board') . '</a></small>';
-
- else:
- $resume = ' <small>Resume[deleted]</small>';
-
- endif;
- echo apply_filters('sjb_applicant_resume', $resume, $post->ID);
- ?>
- </h3>
- <?php
- /**
- * Action -> Fires after Resume Link
- *
- * @since 2.3.0
- */
- do_action('sjb_resume_link_after', $post->ID);
- ?>
- <!-- Applicant's Detail in Admin Area -->
- <table class="widefat striped">
- <?php
- /**
- * Fires at start of applicant details
- *
- * @since 2.2.0
- */
- do_action('sjb_applicants_details_start', $post->ID);
- foreach ($keys as $key):
- if (substr($key, 0, 7) == 'jobapp_') {
- if (!is_serialized(get_post_meta($post->ID, $key, TRUE))) {
- echo '<tr><td>' . ucwords(str_replace('_', ' ', substr($key, 7))) . '</td><td>' . get_post_meta($post->ID, $key, TRUE) . '</td></tr>';
- } else {
- $values = unserialize(get_post_meta($post->ID, $key, TRUE));
- if (is_array($values)) {
- echo '<tr><td>' . ucwords(str_replace('_', ' ', substr($key, 7))) . '</td><td>';
- $count = sizeof($values);
- foreach ($values as $val):
- echo esc_attr($val);
- if ($count > 1) {
- echo ', ';
- }
- $count--;
- endforeach;
- echo '</td></tr>';
- } else {
- echo '<tr><td>' . ucwords(str_replace('_', ' ', substr($key, 7))) . '</td><td>' . get_post_meta($post->ID, $key, TRUE) . '</td></tr>';
- }
- }
- }
- endforeach;
- /**
- * Fires at the end of applicant details
- *
- * @since 2.2.0
- */
- do_action('sjb_applicants_details_end', $post->ID);
- ?>
- </table>
- </div>
- <?php
- /**
- * Fires after displaying the applicant details
- *
- * @since 2.2.0
- */
- do_action('sjb_applicants_details_after', $post->ID);
- ?>
- <h2><?php esc_html_e('Application Notes', 'simple-job-board'); ?></h2>
- <?php
- /**
- * Fires after displaying the applicant details
- *
- * @since 2.2.0
- */
- do_action('sjb_applicantion_notes', $post->ID);
- endif;
- }
- }
- new Simple_Job_Board_Applicants();
|