コード例 #1
0
    /**
     * 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);
    }
コード例 #2
0
/**
 * Output the candidate video
 */
function the_candidate_video($post = null)
{
    $video = get_the_candidate_video($post);
    $video = is_ssl() ? str_replace('http:', 'https:', $video) : $video;
    $filetype = wp_check_filetype($video);
    if (!empty($filetype['ext'])) {
        $video_embed = wp_video_shortcode(array('src' => $video));
    } else {
        $video_embed = wp_oembed_get($video);
    }
    if ($video_embed) {
        echo '<div class="candidate-video">' . $video_embed . '</div>';
    }
}
コード例 #3
0
/**
 * Output the candidate video
 */
function the_candidate_video($post = null)
{
    $video = get_the_candidate_video($post);
    $video = is_ssl() ? str_replace('http:', 'https:', $video) : $video;
    $video_embed = wp_oembed_get($video);
    if ($video_embed) {
        echo '<div class="candidate-video">' . $video_embed . '</div>';
    }
}