?> </div> <?php } else { ?> <?php /** * single_job_listing_start hook * * @hooked job_listing_meta_display - 20 * @hooked job_listing_company_display - 30 */ ?> <?php if (is_position_filled()) { ?> <div class="alert alert-warning position-filled"><?php _e('This position has been filled', 'wp-job-manager'); ?> </div> <?php } elseif (!candidates_can_apply() && 'preview' !== $post->post_status) { ?> <div class="alert alert-warning listing-expired"><?php _e('Applications have closed', 'wp-job-manager'); ?> </div> <?php } ?>
/** * widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ function widget($args, $instance) { if ($this->get_cached_widget($args)) { return; } $descriptor = isset($instance['descriptor']) ? esc_attr($instance['descriptor']) : false; $biography = isset($instance['biography']) && 1 == $instance['biography'] ? true : false; global $post; extract($args); ob_start(); echo $before_widget; ?> <div class="job_listing-author"> <div class="job_listing-author-avatar"> <?php echo get_avatar(get_the_author_meta('ID'), 210); ?> </div> <div class="job_listing-author-info"> <?php the_author(); ?> <small class="job_listing-author-descriptor"><?php echo $descriptor; ?> </small> <?php if ('preview' != $post->post_status) { ?> <div class="job_listing-author-info-more"> <a href="#job_listing-author-apply" data-mfp-src=".job_application" class="popup-trigger"><span class="ion-email"></span></a> <?php if (!is_position_filled() && $post->post_status == 'publish') { get_job_manager_template('job-application.php'); } ?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> "><span class="ion-information-circled"></span></a> </div> <?php } ?> </div> <?php if ($biography && ($bio = get_the_author_meta('description', get_the_author_meta('ID')))) { ?> <div class="job_listing-author-biography"> <?php echo $bio; ?> </div> <?php } ?> <?php do_action('listify_widget_job_listing_author_after'); ?> </div> <?php echo $after_widget; $content = ob_get_clean(); echo apply_filters($this->widget_id, $content); $this->cache_widget($args, $content); }
/** * get_job_listing_class function. * * @access public * @return array */ function get_job_listing_class($class = '', $post_id = null) { $post = get_post($post_id); if ($post->post_type !== 'job_listing') { return array(); } $classes = array(); if (empty($post)) { return $classes; } $classes[] = 'job_listing'; $classes[] = 'job-type-' . sanitize_title(get_the_job_type()->name); if (is_position_filled($post)) { $classes[] = 'job_position_filled'; } if (is_position_featured($post)) { $classes[] = 'job_position_featured'; } return get_post_class($classes, $post->ID); }
} elseif ('date' === $key) { ?> <?php echo date_i18n(get_option('date_format'), strtotime($job->post_date)); ?> <?php } elseif ('expires' === $key) { ?> <?php echo $job->_job_expires ? date_i18n(get_option('date_format'), strtotime($job->_job_expires)) : '–'; ?> <?php } elseif ('filled' === $key) { ?> <?php echo is_position_filled($job) ? '✔' : '–'; ?> <?php } else { ?> <?php do_action('job_manager_job_dashboard_column_' . $key, $job); ?> <?php } ?> </td> <?php } ?> </tr>
/** * widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ function widget($args, $instance) { if ($this->get_cached_widget($args)) { return; } ob_start(); extract($args); global $post; if ('preview' == $post->post_status) { return; } $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '', $instance, $this->id_base); echo $before_widget; ?> <?php if ($title) { echo $before_title . $title . $after_title; } ?> <?php if ('job_listing' == get_post_type()) { ?> <?php if (!is_position_filled()) { ?> <?php get_job_manager_template('job-application.php'); ?> <?php } ?> <?php if ('' != get_the_company_video()) { ?> <a href="#company-video" class="button view-video popup-trigger"><?php _e('Watch Video', 'jobify'); ?> </a> <div id="company-video" class="modal"> <?php the_company_video(); ?> </div> <?php } ?> <?php } else { ?> <?php get_job_manager_template('contact-details.php', array('post' => $post), 'resume_manager', RESUME_MANAGER_PLUGIN_DIR . '/templates/'); ?> <?php if ('' != get_the_candidate_video()) { ?> <a href="#candidate-video" class="button view-video popup-trigger"><?php _e('Video Resume', 'jobify'); ?> </a> <div id="candidate-video" class="modal"> <?php the_candidate_video(); ?> </div> <?php } ?> <?php } ?> <?php do_action('jobify_widget_job_apply_after'); ?> <?php echo $after_widget; $content = ob_get_clean(); echo apply_filters('jobify_widget_job_apply', $content, $instance, $args); $this->cache_widget($args, $content); }
* single_job_listing_start hook * * @hooked job_listing_meta_display - 20 * @hooked job_listing_company_display - 30 */ do_action('single_job_listing_start'); ?> <div class="job_description" itemprop="description"> <?php echo apply_filters('the_job_description', get_the_content()); ?> </div> <?php if (!is_position_filled() && $post->post_status !== 'preview') { ?> <?php get_job_manager_template('job-application.php'); ?> <?php } ?> <?php /** * single_job_listing_end hook */ do_action('single_job_listing_end'); ?>
/** * get_job_listing_class function. * * @access public * @return array */ function get_job_listing_class($class = '', $post_id = null) { $post = get_post($post_id); if ($post->post_type !== 'job_listing') { return array(); } $classes = array(); if (empty($post)) { return $classes; } $classes[] = 'job_listing'; if ($job_type = get_the_job_type()) { $classes[] = 'job-type-' . sanitize_title($job_type->name); } if (is_position_filled($post)) { $classes[] = 'job_position_filled'; } if (is_position_featured($post)) { $classes[] = 'job_position_featured'; } if (!empty($class)) { if (!is_array($class)) { $class = preg_split('#\\s+#', $class); } $classes = array_merge($classes, $class); } return get_post_class($classes, $post->ID); }
/** * custom_columns function. * * @access public * @param mixed $column * @return void */ public function custom_columns($column) { global $post, $job_manager; switch ($column) { case "job_listing_type": $type = get_the_job_type($post); if ($type) { echo '<span class="job-type ' . $type->slug . '">' . $type->name . '</span>'; } break; case "job_position": echo '<div class="job_position">'; echo '<a href="' . admin_url('post.php?post=' . $post->ID . '&action=edit') . '" class="tips job_title" data-tip="' . sprintf(__('Job ID: %d', 'wp-job-manager'), $post->ID) . '">' . $post->post_title . '</a>'; echo '<div class="location">'; if (get_the_company_website()) { the_company_name('<span class="tips" data-tip="' . esc_attr(get_the_company_tagline()) . '"><a href="' . get_the_company_website() . '">', '</a></span> – '); } else { the_company_name('<span class="tips" data-tip="' . esc_attr(get_the_company_tagline()) . '">', '</span> – '); } the_job_location($post); echo '</div>'; the_company_logo(); echo '</div>'; break; case "job_listing_category": if (!($terms = get_the_term_list($post->ID, $column, '', ', ', ''))) { echo '<span class="na">–</span>'; } else { echo $terms; } break; case "filled": if (is_position_filled($post)) { echo '✔'; } else { echo '–'; } break; case "featured_job": if (is_position_featured($post)) { echo '✔'; } else { echo '–'; } break; case "job_posted": echo '<strong>' . date_i18n(__('M j, Y', 'wp-job-manager'), strtotime($post->post_date)) . '</strong><span>'; echo (empty($post->post_author) ? __('by a guest', 'wp-job-manager') : sprintf(__('by %s', 'wp-job-manager'), '<a href="' . get_edit_user_link($post->post_author) . '">' . get_the_author() . '</a>')) . '</span>'; break; case "job_expires": if ($post->_job_expires) { echo '<strong>' . date_i18n(__('M j, Y', 'wp-job-manager'), strtotime($post->_job_expires)) . '</strong>'; } else { echo '–'; } break; case "job_status": echo get_the_job_status($post); break; case "job_actions": echo '<div class="actions">'; $admin_actions = array(); if ($post->post_status == 'pending') { $admin_actions['approve'] = array('action' => 'approve', 'name' => __('Approve', 'wp-job-manager'), 'url' => wp_nonce_url(add_query_arg('approve_job', $post->ID), 'approve_job')); } if ($post->post_status !== 'trash') { $admin_actions['view'] = array('action' => 'view', 'name' => __('View', 'wp-job-manager'), 'url' => get_permalink($post->ID)); $admin_actions['edit'] = array('action' => 'edit', 'name' => __('Edit', 'wp-job-manager'), 'url' => get_edit_post_link($post->ID)); $admin_actions['delete'] = array('action' => 'delete', 'name' => __('Delete', 'wp-job-manager'), 'url' => get_delete_post_link($post->ID)); } $admin_actions = apply_filters('job_manager_admin_actions', $admin_actions, $post); foreach ($admin_actions as $action) { printf('<a class="button tips icon-%s" href="%s" data-tip="%s">%s</a>', sanitize_title($action['name']), esc_url($action['url']), esc_attr($action['name']), esc_attr($action['name'])); } echo '</div>'; break; } }
?> <?php } ?> </td> <?php } ?> <td> <ul class="job-dashboard-actions"> <?php $actions = array(); switch ($job->post_status) { 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); }