plugin updates
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/* Prohibit direct script loading */
|
||||
defined('ABSPATH') || die('No direct script access allowed!');
|
||||
wp_enqueue_script('wpmf-gallery');
|
||||
|
||||
$class_default = array();
|
||||
$class_default[] = 'gallery gallery_life wpmf_gallery_default gallery_default ';
|
||||
$class_default[] = 'gallery-columns-' . $columns;
|
||||
$class_default[] = 'gallery-size-' . $size_class;
|
||||
$class_default[] = 'gallery-link-' . $link;
|
||||
$class_default[] = 'wpmf-has-border-radius-' . $img_border_radius;
|
||||
$class_default[] = 'wpmf-gutterwidth-' . $gutterwidth;
|
||||
if ($aspect_ratio !== 'default') {
|
||||
$class_default[] = 'ratio_' . $aspect_ratio;
|
||||
} else {
|
||||
$class_default[] = 'no_ratio';
|
||||
}
|
||||
$style = '';
|
||||
if ($img_shadow !== '') {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item img:hover {box-shadow: ' . $img_shadow . ' !important; transition: all 200ms ease;}';
|
||||
}
|
||||
|
||||
if ($border_style !== 'none') {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item img {border: ' . $border_color . ' '. $border_width .'px '. $border_style .'}';
|
||||
}
|
||||
wp_add_inline_style('wpmf-gallery-style', $style);
|
||||
$output = '';
|
||||
if (!empty($is_divi)) {
|
||||
$output .= '<style>' . $style . '</style>';
|
||||
}
|
||||
$galleryStyle = '';
|
||||
if ($align === 'alignleft' || $align === 'alignright' || $align === 'aligncenter') {
|
||||
$galleryStyle = 'style="width: 100%; max-width: 620px!important;"';
|
||||
} elseif ($align === 'none') {
|
||||
$align = '';
|
||||
}
|
||||
$output .= '<div class="wpmf-gallerys wpmf-gallerys-life '. $align . '" '. $galleryStyle .'>';
|
||||
$output .= '<div id="' . $selector . '" class="' . implode(' ', $class_default) . '">';
|
||||
|
||||
$pos = 0;
|
||||
foreach ($gallery_items as $item_id => $attachment) {
|
||||
if (strpos($attachment->post_excerpt, '<script>') !== false) {
|
||||
$post_excerpt = esc_html($attachment->post_excerpt);
|
||||
} else {
|
||||
$post_excerpt = $attachment->post_excerpt;
|
||||
}
|
||||
|
||||
$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, $pos);
|
||||
break;
|
||||
case 'post':
|
||||
$image_output = $this->getAttachmentLink($item_id, $size, true, $targetsize, false, $link_target, $pos);
|
||||
break;
|
||||
case 'none':
|
||||
$image_output = wp_get_attachment_image($item_id, $size, false, array('data-type' => 'wpmfgalleryimg'));
|
||||
break;
|
||||
case 'custom':
|
||||
$image_output = $this->getAttachmentLink($item_id, $size, false, $targetsize, true, $link_target, $pos);
|
||||
break;
|
||||
default:
|
||||
$image_output = $this->getAttachmentLink($item_id, $size, false, $targetsize, false, $link_target, $pos);
|
||||
}
|
||||
|
||||
if ($enable_download) {
|
||||
$image_output .= '<a href="'.esc_url($downloads['download_link']).'" '. (($downloads['type'] === 'local') ? 'download' : '') .' class="wpmf_gallery_download_icon"><span class="material-icons-outlined"> file_download </span></a>';
|
||||
}
|
||||
|
||||
$output .= '<figure class="wpmf-gallery-item" data-index="'. esc_attr($pos) .'">';
|
||||
$output .= '<div class="wpmf-gallery-icon">';
|
||||
$output .= wpmfRenderVideoIcon($attachment->ID);
|
||||
$output .= '<div class="square_thumbnail">';
|
||||
$output .= '<div class="img_centered">';
|
||||
$output .= $image_output;
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
if (trim($post_excerpt) !== '') {
|
||||
$output .= '<figcaption class="wp-caption-text gallery-caption">';
|
||||
$output .= wptexturize($post_excerpt);
|
||||
$output .= '</figcaption>';
|
||||
}
|
||||
$output .= '</figure>';
|
||||
$pos++;
|
||||
}
|
||||
$output .= '</div></div>';
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/* Prohibit direct script loading */
|
||||
defined('ABSPATH') || die('No direct script access allowed!');
|
||||
wp_enqueue_script('jquery-masonry');
|
||||
wp_enqueue_script('wpmf-gallery');
|
||||
// getting rid of float
|
||||
$class[] = 'gallery_life gallery-' . $display;
|
||||
$class[] = 'gallery-columns-' . $columns;
|
||||
$class[] = 'gallery-size-' . $size_class;
|
||||
$class[] = 'wpmf-gallery-bottomspace-' . $bottomspace;
|
||||
$class[] = 'wpmf-gallery-clear';
|
||||
$class[] = 'wpmf-has-border-radius-' . $img_border_radius;
|
||||
$class[] = 'wpmf-gutterwidth-' . $gutterwidth;
|
||||
$class = implode(' ', $class);
|
||||
|
||||
$padding_masonry = get_option('wpmf_padding_masonry');
|
||||
if (!isset($padding_masonry) && $padding_masonry === '') {
|
||||
$padding_masonry = 5;
|
||||
}
|
||||
|
||||
$gutterwidth = isset($gutterwidth) ? $gutterwidth : $padding_masonry;
|
||||
$style = '';
|
||||
if ($img_shadow !== '') {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item img:hover {box-shadow: ' . $img_shadow . ' !important; transition: all 200ms ease;}';
|
||||
}
|
||||
|
||||
if ($border_style !== 'none') {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item img {border: ' . $border_color . ' '. $border_width .'px '. $border_style .'}';
|
||||
}
|
||||
$galleryStyle = '';
|
||||
if ($align === 'alignleft' || $align === 'alignright' || $align === 'aligncenter') {
|
||||
$galleryStyle = 'style="width: 100%; max-width: 620px!important;"';
|
||||
} elseif ($align === 'none') {
|
||||
$align = '';
|
||||
}
|
||||
wp_add_inline_style('wpmf-gallery-style', $style);
|
||||
$output = '';
|
||||
if (!empty($is_divi)) {
|
||||
$output .= '<style>' . $style . '</style>';
|
||||
}
|
||||
$output .= '<div class="wpmf-gallerys wpmf-gallerys-life '. $align .'" '.$galleryStyle.'>';
|
||||
$output .= '<div id="' . $selector . '"
|
||||
data-gutter-width="' . $gutterwidth . '"
|
||||
data-wpmfcolumns="' . $columns . '" class="' . $class . '">';
|
||||
|
||||
$pos = 0;
|
||||
foreach ($gallery_items as $item_id => $attachment) {
|
||||
$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, $pos);
|
||||
break;
|
||||
case 'post':
|
||||
$image_output = $this->getAttachmentLink($item_id, $size, true, $targetsize, false, $link_target, $pos);
|
||||
break;
|
||||
case 'none':
|
||||
$image_output = wp_get_attachment_image($item_id, $size, false, array('data-type' => 'wpmfgalleryimg'));
|
||||
break;
|
||||
case 'custom':
|
||||
$image_output = $this->getAttachmentLink($item_id, $size, false, $targetsize, true, $link_target, $pos);
|
||||
break;
|
||||
default:
|
||||
$image_output = $this->getAttachmentLink($item_id, $size, false, $targetsize, false, $link_target, $pos);
|
||||
}
|
||||
|
||||
if ($enable_download) {
|
||||
$image_output .= '<a href="'.esc_url($downloads['download_link']).'" '. (($downloads['type'] === 'local') ? 'download' : '') .' class="wpmf_gallery_download_icon"><span class="material-icons-outlined"> file_download </span></a>';
|
||||
}
|
||||
|
||||
$output .= '<div class="wpmf-gallery-item
|
||||
wpmf-gallery-item-position-' . $pos . ' wpmf-gallery-item-attachment-' . $item_id . '" data-index="'. esc_attr($pos) .'">';
|
||||
$output .= '<div class="wpmf-gallery-icon">';
|
||||
$output .= wpmfRenderVideoIcon($attachment->ID);
|
||||
$output .= $image_output;
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
$pos++;
|
||||
}
|
||||
$output .= "</div></div>\n";
|
||||
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
/* Prohibit direct script loading */
|
||||
defined('ABSPATH') || die('No direct script access allowed!');
|
||||
wp_enqueue_script('jquery-masonry');
|
||||
wp_enqueue_script('wpmf-gallery');
|
||||
$class[] = 'gallery_life wpmf_gallery_default gallery_default gallery-portfolio ';
|
||||
$class[] = 'gallery-columns-' . $columns;
|
||||
$class[] = 'gallery-size-' . $size_class;
|
||||
$class[] = 'wpmf-gallery-bottomspace-' . $bottomspace;
|
||||
$class[] = 'wpmf-gallery-clear';
|
||||
$class[] = 'wpmf-has-border-radius-' . $img_border_radius;
|
||||
$class[] = 'wpmf-gutterwidth-' . $gutterwidth;
|
||||
$class[] = 'ratio_' . $aspect_ratio;
|
||||
$class = implode(' ', $class);
|
||||
|
||||
$padding_portfolio = get_option('wpmf_padding_portfolio');
|
||||
if (!isset($padding_portfolio) && $padding_portfolio === '') {
|
||||
$padding_portfolio = 10;
|
||||
}
|
||||
|
||||
$gutterwidth = isset($gutterwidth) ? $gutterwidth : $padding_portfolio;
|
||||
$style = '';
|
||||
if ($img_shadow !== '') {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item .wpmf_overlay:hover {box-shadow: ' . $img_shadow . ' !important; transition: all 200ms ease;}';
|
||||
}
|
||||
|
||||
if ($border_style !== 'none') {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item img {border: ' . $border_color . ' '. $border_width .'px '. $border_style .'}';
|
||||
}
|
||||
wp_add_inline_style('wpmf-gallery-style', $style);
|
||||
$output = '';
|
||||
if (!empty($is_divi)) {
|
||||
$output .= '<style>' . $style . '</style>';
|
||||
}
|
||||
$galleryStyle = '';
|
||||
if ($align === 'alignleft' || $align === 'alignright' || $align === 'aligncenter') {
|
||||
$galleryStyle = 'style="width: 100%; max-width: 620px!important;"';
|
||||
} elseif ($align === 'none') {
|
||||
$align = '';
|
||||
}
|
||||
$output .= '<div class="wpmf-gallerys wpmf-gallerys-life '. $align . '" ' . $galleryStyle . '>';
|
||||
$output .= '<div id="' . $selector . '"
|
||||
data-gutter-width="' . $gutterwidth . '"
|
||||
data-wpmfcolumns="' . $columns . '" class="' . $class . '">';
|
||||
|
||||
$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 = '<a data-lightbox="' . $lb . '" data-href="' . $lightbox_url . '" title="' . esc_attr($lb_title) . '"
|
||||
class="noLightbox wpmf_overlay ' . $tclass . ' '. (!empty($remote_video) ? 'isvideo' : 'not_video') .'" target="' . $link_target . '" data-index="'. esc_attr($pos) .'"></a>
|
||||
<a data-lightbox="' . $lb . '" class="noLightbox portfolio_lightbox ' . $tclass . ' '. (!empty($remote_video) ? 'isvideo' : 'not_video') .'" data-href="' . $lightbox_url . '" title="' . esc_attr($lb_title) . '"
|
||||
target="' . $link_target . '" data-index="'. esc_attr($pos) .'">+</a>';
|
||||
|
||||
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 = '<a data-href="' . $url_image . '" title="' . esc_attr($post_title) . '" class="wpmf_overlay ' . $tclass . '" target="' . $link_target . '" data-index="'. esc_attr($pos) .'"></a>';
|
||||
$icon .= '<a class="portfolio_lightbox ' . $tclass . '" data-href="' . $url_image . '" target="' . $link_target . '" data-index="'. esc_attr($pos) .'">+</a>';
|
||||
break;
|
||||
case 'none':
|
||||
$image_output = wp_get_attachment_image($item_id, $size, false, array('data-type' => 'wpmfgalleryimg'));
|
||||
$icon = '<span class="wpmf_overlay" data-index="'. esc_attr($pos) .'"></span><span class="hide_icon portfolio_lightbox" data-index="'. esc_attr($pos) .'">+</span>';
|
||||
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 = '<a data-href="' . $url_image . '" title="' . esc_attr($post_title) . '" class="wpmf_overlay ' . $tclass . '" target="' . $link_target . '" data-index="'. esc_attr($pos) .'"></a>';
|
||||
$icon .= '<a class="portfolio_lightbox ' . $tclass . '" data-href="' . $url_image . '" target="' . $link_target . '" data-index="'. esc_attr($pos) .'">+</a>';
|
||||
break;
|
||||
default:
|
||||
$image_output = $this->getAttachmentLink($item_id, $size, true, $targetsize, false, $link_target);
|
||||
}
|
||||
|
||||
if ($enable_download) {
|
||||
$image_output .= '<a data-href="'.esc_url($downloads['download_link']).'" '. (($downloads['type'] === 'local') ? 'download' : '') .' class="wpmf_gallery_download_icon"><span class="material-icons-outlined"> file_download </span></a>';
|
||||
}
|
||||
|
||||
$output .= '<figure class="wpmf-gallery-item
|
||||
wpmf-gallery-item-position-'. $pos .' wpmf-gallery-item-attachment-' . $item_id . '" data-index="'. esc_attr($pos) .'">';
|
||||
$output .= '<div class="wpmf-gallery-icon">';
|
||||
$output .= wpmfRenderVideoIcon($attachment->ID);
|
||||
$output .= $icon;
|
||||
$output .= '<div class="square_thumbnail">';
|
||||
$output .= '<div class="img_centered">';
|
||||
$output .= $image_output;
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
|
||||
if (trim($attachment->post_excerpt) || trim($attachment->post_title)) {
|
||||
$output .= '<div class="wpmf-caption-text wpmf-gallery-caption">';
|
||||
if ($attachment->post_title !== '') {
|
||||
$output .= '<span class="title">' . wptexturize(esc_html($attachment->post_title)) . '</span>';
|
||||
}
|
||||
|
||||
if ($attachment->post_excerpt !== '') {
|
||||
$output .= '<span class="excerpt">' . wptexturize($attachment->post_excerpt) . '</span>';
|
||||
}
|
||||
|
||||
if ($attachment->post_content !== '' && defined('WPMF_DISPLAY_GALLERY_DESCRIPTION')) {
|
||||
$output .= '<span class="wpmf_attachment_content">' . wptexturize($attachment->post_content) . '</span>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
}
|
||||
$output .= '</figure>';
|
||||
|
||||
$pos++;
|
||||
}
|
||||
$output .= "</div></div>\n";
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/* Prohibit direct script loading */
|
||||
defined('ABSPATH') || die('No direct script access allowed!');
|
||||
|
||||
wp_enqueue_style('wpmf-slick-style');
|
||||
wp_enqueue_style('wpmf-slick-theme-style');
|
||||
wp_enqueue_script('wpmf-slick-script');
|
||||
wp_enqueue_script('wpmf-gallery');
|
||||
|
||||
$class_default = array();
|
||||
$class_default[] = 'gallery gallery_life wpmfslick wpmfslick_life ';
|
||||
$class_default[] = 'gallery-link-' . $link;
|
||||
$class_default[] = 'wpmf-has-border-radius-' . $img_border_radius;
|
||||
$class_default[] = 'wpmf-gutter-' . $gutterwidth;
|
||||
$class_default[] = (((int)$columns > 1) ? 'wpmfslick_multiplecolumns' : 'wpmf-gg-one-columns');
|
||||
$class_default[] = 'ratio_' . $aspect_ratio;
|
||||
$crop = (isset($crop_image)) ? $crop_image : 1;
|
||||
if ((int)$columns === 1) {
|
||||
$crop = 0;
|
||||
}
|
||||
$class_default[] = 'wpmf-slick-crop-' . $crop;
|
||||
$shadow = 0;
|
||||
$style = '';
|
||||
if ($img_shadow !== '') {
|
||||
if ((int)$columns > 1) {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item .wpmf-gallery-icon:hover {box-shadow: ' . $img_shadow . ' !important; transition: all 200ms ease;}';
|
||||
$shadow = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((int)$gutterwidth === 0) {
|
||||
$shadow = 0;
|
||||
}
|
||||
if ($border_style !== 'none') {
|
||||
if ((int)$columns === 1) {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item img:not(.glrsocial_image) {border: ' . $border_color . ' ' . $border_width . 'px ' . $border_style . ';}';
|
||||
} else {
|
||||
$style .= '#' . $selector . ' .wpmf-gallery-item .wpmf-gallery-icon {border: ' . $border_color . ' ' . $border_width . 'px ' . $border_style . ';}';
|
||||
}
|
||||
} else {
|
||||
$border_width = 0;
|
||||
}
|
||||
|
||||
$galleryStyle = '';
|
||||
if ($align === 'alignleft' || $align === 'alignright' || $align === 'aligncenter') {
|
||||
$galleryStyle = 'style="width: 100%; max-width: 620px!important;"';
|
||||
} elseif ($align === 'none') {
|
||||
$align = '';
|
||||
}
|
||||
wp_add_inline_style('wpmf-gallery-style', $style);
|
||||
$output = '';
|
||||
if (!empty($is_divi)) {
|
||||
$output .= '<style>' . $style . '</style>';
|
||||
}
|
||||
|
||||
$items = array();
|
||||
foreach ($gallery_items as $item_id => $attachment) {
|
||||
$post_title = (!empty($caption_lightbox) && $attachment->post_excerpt !== '') ? $attachment->post_excerpt : $attachment->post_title;
|
||||
$remote_video = get_post_meta($attachment->ID, 'wpmf_remote_video_link', true);
|
||||
$item_urls = wp_get_attachment_image_url($attachment->ID, $targetsize);
|
||||
$url = (!empty($remote_video)) ? $remote_video : $item_urls;
|
||||
if (!empty($remote_video)) {
|
||||
$lightbox_urls = $this->getLightboxUrl($attachment->ID, $targetsize);
|
||||
$url = $lightbox_urls['url'];
|
||||
$items[] = array('src' => $url, 'title' => $post_title, 'type' => 'iframe');
|
||||
} else {
|
||||
$url = $item_urls;
|
||||
$items[] = array('src' => $url, 'title' => $post_title, 'type' => 'image');
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '<div class="wpmf-gallerys wpmf-gallerys-life '. $align . '" data-items="'. esc_attr(json_encode($items)) .'" '.$galleryStyle.'>';
|
||||
$output .= '<div id="' . $selector . '" data-id="' . $selector . '" data-gutterwidth="' . $gutterwidth . '"
|
||||
class="' . implode(' ', $class_default) . '" data-count="'. esc_attr(count($gallery_items)) .'" data-wpmfcolumns="' . $columns . '" data-auto_animation="' . esc_html($autoplay) . '" data-duration="' . (int)$duration . '" data-border-width="' . $border_width . '" data-shadow="' . $shadow . '">';
|
||||
|
||||
$pos = 0;
|
||||
$caption_lightbox = wpmfGetOption('caption_lightbox_gallery');
|
||||
foreach ($gallery_items as $item_id => $attachment) {
|
||||
$post_title = (!empty($caption_lightbox) && $attachment->post_excerpt !== '') ? $attachment->post_excerpt : $attachment->post_title;
|
||||
$post_excerpt = esc_html($attachment->post_excerpt);
|
||||
$image_alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
|
||||
if ($image_alt === '') {
|
||||
$image_alt = $attachment->post_title;
|
||||
}
|
||||
$img_tags = get_post_meta($attachment->ID, 'wpmf_img_tags', true);
|
||||
$link_target = get_post_meta($attachment->ID, '_gallery_link_target', true);
|
||||
$custom_link = get_post_meta($attachment->ID, _WPMF_GALLERY_PREFIX . 'custom_image_link', true);
|
||||
$downloads = $this->wpmfGalleryGetDownloadLink($attachment->ID);
|
||||
$lightbox = 0;
|
||||
$url = '';
|
||||
if ($custom_link !== '') {
|
||||
$image_output = $this->getAttachmentLink($attachment->ID, $size, false, $targetsize, true, $link_target, $pos);
|
||||
$icon = '<a data-href="' . $custom_link . '" title="' . esc_attr($post_title) . '" class="wpmf_overlay" target="' . $link_target . '" data-index="'. esc_attr($pos) .'"></a>';
|
||||
} else {
|
||||
switch ($link) {
|
||||
case 'none':
|
||||
$icon = '<span class="wpmf_overlay" data-index="'. esc_attr($pos) .'"></span>';
|
||||
break;
|
||||
|
||||
case 'post':
|
||||
$url = get_attachment_link($attachment->ID);
|
||||
$icon = '<a data-href="' . esc_url($url) . '" title="' . esc_attr($post_title) . '" class="wpmf_overlay" target="' . $link_target . '" data-index="'. esc_attr($pos) .'"></a>';
|
||||
break;
|
||||
|
||||
default:
|
||||
$lightbox = 1;
|
||||
$remote_video = get_post_meta($attachment->ID, 'wpmf_remote_video_link', true);
|
||||
$lightbox_urls = $this->getLightboxUrl($attachment->ID, $targetsize);
|
||||
$url = $lightbox_urls['url'];
|
||||
$icon = '<a data-lightbox="1" data-href="' . esc_url($url) . '" title="' . esc_attr($post_title) . '"
|
||||
class="wpmfgalleryaddonswipe wpmf_overlay '. (!empty($remote_video) ? 'isvideo' : '') .'" data-index="'. esc_attr($pos) .'"></a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($enable_download) {
|
||||
$icon .= '<a href="'.esc_url($downloads['download_link']).'" '. (($downloads['type'] === 'local') ? 'download' : '') .' class="wpmf_gallery_download_icon"><span class="material-icons-outlined"> file_download </span></a>';
|
||||
}
|
||||
|
||||
$output .= '<div class="wpmf-gallery-item item" data-index="'. esc_attr($pos) .'" data-tags="' . esc_html($img_tags) . '" style="opacity: 0; padding: '. (int)$gutterwidth / 2 .'px">';
|
||||
$output .= '<div class="wpmf-gallery-icon">';
|
||||
$output .= wpmfRenderVideoIcon($attachment->ID);
|
||||
|
||||
$output .= $icon; // phpcs:ignore WordPress.Security.EscapeOutput -- Content already escaped in the method
|
||||
$output .= '<a class="'. (((int)$columns === 1) ? '' : 'square_thumbnail') .'" data-lightbox="'. esc_attr($lightbox) .'" data-href="' . esc_url($url) . '" title="'. esc_attr($post_title) .'" data-index="'. esc_attr($pos) .'">';
|
||||
if ((int)$columns > 1) {
|
||||
$output .= '<div class="img_centered">';
|
||||
}
|
||||
$output .= '<img alt="'. esc_attr($image_alt) .'" class="wpmf_slider_img" src="'. esc_url(wp_get_attachment_image_url($attachment->ID, $size)) .'">';
|
||||
if ((int)$columns > 1) {
|
||||
$output .= '</div>';
|
||||
}
|
||||
$output .= '</a>';
|
||||
if (trim($attachment->post_excerpt) || trim($attachment->post_title)) {
|
||||
$output .= '<div class="wpmf-slick-text">';
|
||||
if (trim($attachment->post_title)) {
|
||||
$output .= '<span class="title">' . esc_html($attachment->post_title) . '</span>';
|
||||
}
|
||||
|
||||
if (trim($attachment->post_excerpt)) {
|
||||
$output .= '<span class="caption">' . esc_html($attachment->post_excerpt) . '</span>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
$pos++;
|
||||
}
|
||||
$output .= '</div></div>';
|
||||
Reference in New Issue
Block a user