/**
     * 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);
        if (!class_exists('Astoundify_Job_Manager_Companies')) {
            return;
        }
        $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '', $instance, $this->id_base);
        $companies = Astoundify_Job_Manager_Companies::instance();
        $company_url = esc_url($companies->company_url(get_the_company_name()));
        echo $before_widget;
        ?>

		<?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>

		<a href="<?php 
        echo $company_url;
        ?>
" title="<?php 
        printf(__('More jobs by %s', 'jobify'), get_the_company_name());
        ?>
"><i class="icon-newspaper"></i> <?php 
        _e('More Jobs', 'jobify');
        ?>
</a>

		<?php 
        echo $after_widget;
        $content = apply_filters('jobify_widget_job_more_jobs', ob_get_clean(), $instance, $args);
        echo $content;
        $this->cache_widget($args, $content);
    }
    /**
     * 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;
        }
        global $wp_embed;
        ob_start();
        extract($args);
        global $post;
        $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 (class_exists('Astoundify_Job_Manager_Companies') && '' != get_the_company_name()) {
                $companies = Astoundify_Job_Manager_Companies::instance();
                $company_url = esc_url($companies->company_url(get_the_company_name()));
                ?>
			<a href="<?php 
                echo $company_url;
                ?>
" target="_blank"><?php 
                the_company_logo();
                ?>
</a>
			<?php 
            } else {
                ?>
				<?php 
                the_company_logo();
                ?>
			<?php 
            }
            ?>

		<?php 
        } else {
            ?>

			<?php 
            the_candidate_photo('large');
            ?>

		<?php 
        }
        ?>

		<?php 
        echo $after_widget;
        $content = apply_filters('jobify_widget_job_company_logo', ob_get_clean(), $instance, $args);
        echo $content;
        $this->cache_widget($args, $content);
    }
/**
 * Display or retrieve the current company name with optional content.
 *
 * @access public
 * @param mixed $id (default: null)
 * @return void
 */
function the_company_name($before = '', $after = '', $echo = true, $post = null)
{
    $company_name = get_the_company_name($post);
    if (strlen($company_name) == 0) {
        return;
    }
    $company_name = esc_attr(strip_tags($company_name));
    $company_name = $before . $company_name . $after;
    if ($echo) {
        echo $company_name;
    } else {
        return $company_name;
    }
}
Beispiel #4
0
function listable_job_listing_admin_custom_columns($column)
{
    global $post;
    switch ($column) {
        case "listable_job_position":
            echo '<div class="job_position">';
            echo '<a href="' . esc_url(admin_url('post.php?post=' . $post->ID . '&action=edit')) . '" class="tips job_title" data-tip="' . sprintf(esc_html__('ID: %d', 'listable'), $post->ID) . '">' . $post->post_title . '</a>';
            echo '<div class="company">';
            $website = esc_url(get_the_company_website());
            if ($website) {
                the_company_name('<span class="tips" data-tip="' . esc_attr($website) . '"><a href="' . $website . '">', '</a></span>');
            } else {
                the_company_name('<span class="tips" data-tip="' . esc_attr($website) . '">', '</span>');
            }
            echo '</div>';
            echo '</div>';
            break;
        case "listable_job_image":
            $company_logo_ID = listable_get_post_image_id($post->ID);
            $company_logo = '';
            if (!empty($company_logo_ID)) {
                $company_logo = wp_get_attachment_image_src($company_logo_ID);
            }
            if (!empty($company_logo) && (strstr($company_logo[0], 'http') || file_exists($company_logo[0]))) {
                $company_logo = $company_logo[0];
                $company_logo = job_manager_get_resized_image($company_logo, 'thumbnail');
                echo '<img class="company_logo" src="' . esc_attr($company_logo) . '" alt="' . esc_attr(get_the_company_name($post)) . '" />';
            }
            break;
    }
}
<?php

/**
 * Single view Company information box
 *
 * Hooked into single_job_listing_start priority 30
 *
 * @since  1.14.0
 */
if (!get_the_company_name()) {
    return;
}
?>
<div class="company" itemscope itemtype="http://data-vocabulary.org/Organization">
	<?php 
the_company_logo();
?>

	<p class="name">
		<?php 
if ($website = get_the_company_website()) {
    ?>
			<a class="website" href="<?php 
    echo esc_url($website);
    ?>
" itemprop="url" target="_blank" rel="nofollow"><?php 
    _e('Website', 'wp-job-manager');
    ?>
</a>
		<?php 
}
 /**
  * Add custom data to the job feed
  */
 public function job_feed_item()
 {
     $post_id = get_the_ID();
     $location = get_the_job_location($post_id);
     $job_type = get_the_job_type($post_id);
     $company = get_the_company_name($post_id);
     if ($location) {
         echo "<job_listing:location><![CDATA[" . esc_html($location) . "]]></job_listing:location>\n";
     }
     if ($job_type) {
         echo "<job_listing:job_type><![CDATA[" . esc_html($job_type->name) . "]]></job_listing:job_type>\n";
     }
     if ($company) {
         echo "<job_listing:company><![CDATA[" . esc_html($company) . "]]></job_listing:company>\n";
     }
 }
/**
 * Add shortcodes for email content
 * @param  array $data
 */
function job_application_email_add_shortcodes($data)
{
    extract($data);
    $job_title = strip_tags(get_the_title($job_id));
    $dashboard_id = get_option('job_manager_job_dashboard_page_id');
    $job_dashboard_url = $dashboard_id ? htmlspecialchars_decode(add_query_arg(array('action' => 'show_applications', 'job_id' => $job_id), get_permalink($dashboard_id))) : '';
    $meta_data = array();
    $company_name = get_the_company_name($job_id);
    $application_id = $data['application_id'];
    $user_id = $data['user_id'];
    add_shortcode('from_name', function ($atts, $content = '') use($candidate_name) {
        return job_application_email_shortcode_handler($atts, $content, $candidate_name);
    });
    add_shortcode('from_email', function ($atts, $content = '') use($candidate_email) {
        return job_application_email_shortcode_handler($atts, $content, $candidate_email);
    });
    add_shortcode('message', function ($atts, $content = '') use($application_message) {
        return job_application_email_shortcode_handler($atts, $content, $application_message);
    });
    add_shortcode('job_id', function ($atts, $content = '') use($job_id) {
        return job_application_email_shortcode_handler($atts, $content, $job_id);
    });
    add_shortcode('job_title', function ($atts, $content = '') use($job_title) {
        return job_application_email_shortcode_handler($atts, $content, $job_title);
    });
    add_shortcode('job_dashboard_url', function ($atts, $content = '') use($job_dashboard_url) {
        return job_application_email_shortcode_handler($atts, $content, $job_dashboard_url);
    });
    add_shortcode('company_name', function ($atts, $content = '') use($company_name) {
        return job_application_email_shortcode_handler($atts, $content, $company_name);
    });
    add_shortcode('application_id', function ($atts, $content = '') use($application_id) {
        return job_application_email_shortcode_handler($atts, $content, $application_id);
    });
    add_shortcode('user_id', function ($atts, $content = '') use($user_id) {
        return job_application_email_shortcode_handler($atts, $content, $user_id);
    });
    add_shortcode('job_post_meta', function ($atts, $content = '') use($job_id) {
        $atts = shortcode_atts(array('key' => ''), $atts);
        $value = get_post_meta($job_id, sanitize_text_field($atts['key']), true);
        return job_application_email_shortcode_handler($atts, $content, $value);
    });
    foreach (get_job_application_form_fields() as $key => $field) {
        if (in_array('message', $field['rules']) || in_array('from_name', $field['rules']) || in_array('from_email', $field['rules']) || in_array('attachment', $field['rules'])) {
            continue;
        }
        $value = isset($meta[$field['label']]) ? $meta[$field['label']] : '';
        if ($field['type'] === 'resumes' && function_exists('get_resume_share_link') && $value) {
            $value = get_resume_share_link($value);
        }
        $meta_data[$field['label']] = $value;
        add_shortcode($key, function ($atts, $content = '') use($value) {
            return job_application_email_shortcode_handler($atts, $content, $value);
        });
    }
    $meta_data = array_filter($meta_data);
    $meta_data_strings = array();
    foreach ($meta_data as $label => $value) {
        $meta_data_strings[] = $label . ': ' . $value;
    }
    $meta_data_strings = implode("\n", $meta_data_strings);
    add_shortcode('meta_data', function ($atts, $content = '') use($meta_data_strings) {
        return job_application_email_shortcode_handler($atts, $content, $meta_data_strings);
    });
    do_action('job_application_email_add_shortcodes', $data);
}
    echo apply_filters('the_job_description', get_the_content());
    ?>
			</div>

			<?php 
    if (jobify_get_the_company_description()) {
        ?>
			<div itemscope itemtype="http://data-vocabulary.org/Organization" class="job-company-about col-md-<?php 
        echo $col_company;
        ?>
 <?php 
        echo 'top' == $info ? 'col-md-12' : 'col-sm-6 col-xs-12';
        ?>
">
				<h2 class="job-overview-title" itemprop="name"><?php 
        printf(__('About %s', 'jobify'), get_the_company_name());
        ?>
</h2>

				<?php 
        jobify_the_company_description();
        ?>
			</div>
			<?php 
    }
    ?>

			<?php 
    locate_template(array('sidebar-single-job_listing.php'), true, false);
    ?>
		</div>
			<?php 
do_action('single_job_listing_meta_start');
?>

			<li class="job-type <?php 
echo get_the_job_type() ? sanitize_title(get_the_job_type()->slug) : '';
?>
"><?php 
the_job_type();
?>
</li>
			<li class="job-company">
				<?php 
if (class_exists('Astoundify_Job_Manager_Companies') && '' != get_the_company_name()) {
    $companies = Astoundify_Job_Manager_Companies::instance();
    $company_url = esc_url($companies->company_url(get_the_company_name()));
    ?>
				<a href="<?php 
    echo $company_url;
    ?>
" target="_blank"><?php 
    the_company_name();
    ?>
</a>
				<?php 
} else {
    ?>
					<?php 
    the_company_name();
    ?>
				<?php 
    ?>
						</ul>

						<?php 
    if (class_exists('Astoundify_Job_Manager_Companies') || get_option('job_manager_enable_categories')) {
        ?>
						<ul class="company-social">
							<?php 
        if (class_exists('Astoundify_Job_Manager_Companies') && '' != get_the_company_name()) {
            ?>
							<li>
								<a href="<?php 
            echo $company_url;
            ?>
" title="<?php 
            printf(__('More jobs by %s', 'jobify'), get_the_company_name());
            ?>
"><i class="icon-newspaper"></i> <?php 
            _e('More Jobs', 'jobify');
            ?>
</a>
							</li>
							<?php 
        }
        ?>

							<?php 
        if (get_option('job_manager_enable_categories')) {
            $categories = get_the_terms($post->ID, 'job_listing_category');
            if ($categories) {
                $category = current($categories);
<?php

/**
 * Single view Company information box
 *
 * Hooked into single_job_listing_start priority 30
 *
 * @since  1.14.0
 */
if (TRUE || !get_the_company_name()) {
    return;
}
?>
<div class="company panel panel-default" itemscope itemtype="http://data-vocabulary.org/Organization"><div class="panel-body">
  <div class="row">
    <div class="col-sm-3 col-md-2">
      <?php 
the_company_logo();
?>
    </div>
    <div class="col-sm-9 col-md-10">
      <h5 class="name">
        <?php 
the_company_twitter();
?>
        <?php 
the_company_name('<strong itemprop="name">', '</strong>');
?>
      </h5>
      <?php 
if ($website = get_the_company_website()) {
Beispiel #12
0
 /**
  * Create an array of all of the points found.
  *
  * @since Jobify 1.0
  *
  * @return void
  */
 public function json_points()
 {
     $points = array();
     while ($this->jobs->have_posts()) {
         $this->jobs->the_post();
         $job = get_post();
         if (!$job->geolocation_lat) {
             if (!class_exists('WP_Job_Manager_Geocode')) {
                 continue;
             }
             $address_data = WP_Job_Manager_Geocode::get_location_data($job->_job_location);
             if (!is_wp_error($address_data) && $address_data) {
                 foreach ($address_data as $key => $value) {
                     if ($value) {
                         update_post_meta($job->ID, 'geolocation_' . $key, $value);
                     }
                 }
             }
         }
         $points[] = array('job' => $job->ID, 'location' => array($job->geolocation_lat, $job->geolocation_long), 'permalink' => get_permalink(get_post()->ID), 'title' => sprintf(_x('%s at %s', 'Job title at Company Name', 'jobify'), get_post_field('post_title', get_post()->ID), get_the_company_name(get_post()->ID)));
     }
     return $points;
 }