' . $style . ''; } $galleryStyle = ''; if ($align === 'alignleft' || $align === 'alignright' || $align === 'aligncenter') { $galleryStyle = 'style="width: 100%; max-width: 620px!important;"'; } elseif ($align === 'none') { $align = ''; } $output .= '
'; $output .= '
'; $pos = 0; $current_theme = get_option('current_theme'); if (isset($current_theme) && $current_theme === 'Gleam') { $tclass = 'fancybox'; } else { $tclass = ''; } foreach ($gallery_items as $item_id => $attachment) { $post_excerpt = $attachment->post_excerpt; $post_title = $attachment->post_title; $lb_title = (!empty($caption_lightbox) && $post_excerpt !=='') ? $post_excerpt : $post_title; $link_target = get_post_meta($attachment->ID, '_gallery_link_target', true); $link_target = ($link_target !== '') ? $link_target : '_self'; $downloads = $this->wpmfGalleryGetDownloadLink($attachment->ID); switch ($link) { case 'file': $image_output = $this->getAttachmentLink($item_id, $size, false, $targetsize, false, $link_target); $remote_video = get_post_meta($item_id, 'wpmf_remote_video_link', true); $lb = 1; $url = get_post_meta($attachment->ID, _WPMF_GALLERY_PREFIX . 'custom_image_link', true); if ($url !== '') { $lb = 0; } else { if ($targetsize) { if ($attachment->post_mime_type === 'application/pdf') { $link_target = '_blank'; $lb = 0; } else { $lb = 1; } } } $lightbox_urls = $this->getLightboxUrl($attachment->ID, $targetsize); $lightbox_url = $lightbox_urls['url']; $icon = ' +'; break; case 'post': $image_output = $this->getAttachmentLink($item_id, $size, true, $targetsize, false, $link_target); $url_image = get_attachment_link($item_id); if ($attachment->post_mime_type === 'application/pdf') { $url_image = wp_get_attachment_url($attachment->ID); $link_target = '_blank'; } else { $url_image = get_attachment_link($item_id); } $icon = ''; $icon .= '+'; break; case 'none': $image_output = wp_get_attachment_image($item_id, $size, false, array('data-type' => 'wpmfgalleryimg')); $icon = '+'; break; case 'custom': $image_output = $this->getAttachmentLink($item_id, $size, false, $targetsize, true, $link_target); $url_image = get_post_meta($item_id, _WPMF_GALLERY_PREFIX . 'custom_image_link', true); if ($url_image === '') { $url_image = get_attachment_link($item_id); } $icon = ''; $icon .= '+'; break; default: $image_output = $this->getAttachmentLink($item_id, $size, true, $targetsize, false, $link_target); } if ($enable_download) { $image_output .= ' file_download '; } $output .= ''; $pos++; } $output .= "
\n";