예제 #1
0
 function get_mtphr_gallery_thumbnail($post_id = false, $width = false, $height = false)
 {
     $post_id = $post_id ? $post_id : get_the_id();
     // Return the featured image thumbnail
     if ($att_id = get_post_thumbnail_id($post_id)) {
         return wp_get_attachment_image($att_id, apply_filters('mtphr_galleries_thumbnail_size', 'thumbnail'));
     } else {
         // Return the first attachment thumbnail
         $resources = mtphr_gallery_resource_meta($post_id);
         if (is_array($resources) && isset($resources[0])) {
             if (is_array($resources[0])) {
                 return get_mtphr_gallery_resource_thumbnail($resources[0]);
             } else {
                 return mtphr_galleries_thumbnail($resources[0], false, false, apply_filters('mtphr_galleries_thumbnail_size', 'thumbnail'));
             }
         }
     }
     return false;
 }
예제 #2
0
 function mtphr_galleries_metaboxer_gallery_thumbnail($url, $width = false, $height = false, $size = 'medium')
 {
     mtphr_galleries_thumbnail($url, $width, $height, $size);
 }