Esempio n. 1
0
    function generate_filter_item($post_ID, $atts)
    {
        // these arguments will be available from inside $content
        $image = array('post_id' => $post_ID, 'echo' => false, 'width' => 9999, 'class' => 'img-responsive', 'resposnive' => true);
        $image_tag = get_image($image);
        $info = get_post_meta($post_ID, '_mate_info', true);
        $socials = '';
        if (isset($info['socials']) && !empty($info['socials'])) {
            $socials .= '<span class="thumb-info-social-icons">';
            foreach ($info['socials'] as $item) {
                $social_title = spyropress_beautify($item['network']);
                $mailto = 'envelope' == $item['network'] ? 'mailto:' : '';
                $socials .= '<a rel="tooltip" data-placement="bottom" target="_blank" href="' . $mailto . $item['url'] . '" data-original-title="' . $social_title . '"><i class="fa fa-' . $item['network'] . '"></i><span>' . $social_title . '</span></a> ';
            }
            $socials .= '</span>';
        }
        $terms = get_the_terms($post_ID, 'designation');
        $terms_name = $terms_slug = array();
        if (!empty($terms) && !is_wp_error($terms)) {
            foreach ($terms as $term) {
                $terms_name[] = $term->name;
                $terms_slug[] = $term->slug;
            }
        }
        $url = isset($info['link_page']) && !empty($info['link_page']) ? get_permalink($info['link_page']) : '#';
        // item tempalte
        return '
        <li class="col-sm-6 col-xs-12 ' . $atts['column_class'] . ' isotope-item ' . join(' ', $terms_slug) . '">
			<div class="team-item thumbnail">
				<a href="' . $url . '" class="thumb-info team">
					' . $image_tag . '
					<span class="thumb-info-title">
						<span class="thumb-info-inner">' . get_the_title() . '</span>
						<span class="thumb-info-type">' . join(', ', $terms_name) . '</span>
					</span>
				</a>
				<span class="thumb-info-caption">
					' . do_shortcode($info['about']) . '
					' . $socials . '
				</span>
			</div>
		</li>';
    }
 /**
  * Add MetaBoxes to the post type
  */
 public function add_meta_box($id, $title = '', $fields = array(), $meta_key = false, $build_tabs = true, $context = 'normal', $priority = 'default')
 {
     // checks
     if (empty($id)) {
         return;
     }
     $title = empty($title) ? $id : $title;
     // Meta variables
     $box_id = spyropress_uglify($id);
     $box_title = spyropress_beautify($title);
     $box_context = $context;
     $box_priority = $priority;
     $args = array('id' => $box_id, 'title' => $box_title, 'context' => $context, 'priority' => $priority, 'meta_key' => $meta_key, 'build_tabs' => $build_tabs, 'post_type_slug' => $this->slug, 'fields' => $fields);
     $this->meta_boxes[$id] = $args;
 }