/** * 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; $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '', $instance, $this->id_base); $resume_file = get_post_meta($post->ID, '_resume_file', true); if (!$resume_file) { return; } echo $before_widget; ?> <?php if ($title) { echo $before_title . $title . $after_title; } ?> <a rel="nofollow" href="<?php echo function_exists('get_resume_file_download_url') ? esc_url(get_resume_file_download_url($post->ID)) : esc_url($resume_file); ?> " class="resume-file resume-file-<?php echo substr(strrchr($resume_file, '.'), 1); ?> "><?php printf(__('Resume.%s', 'jobify'), substr(strrchr($resume_file, '.'), 1)); ?> </a> <?php echo $after_widget; $content = apply_filters('jobify_widget_resume_file', ob_get_clean(), $instance, $args); echo $content; $this->cache_widget($args, $content); }
<?php if (($resume_files = get_resume_files()) && apply_filters('resume_manager_user_can_download_resume_file', true, $post->ID)) { ?> <?php foreach ($resume_files as $key => $resume_file) { ?> <li class="resume-file resume-file-<?php echo substr(strrchr($resume_file, '.'), 1); ?> "> <a rel="nofollow" href="<?php echo esc_url(get_resume_file_download_url(null, $key)); ?> "><?php echo basename($resume_file); ?> </a> </li> <?php } }