PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.37
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.37
3.37 3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 All 142 releases
← All changes | Layouts/Slideshow.php +5 -17 3.33 → 3.37 View file →
@@ -26,9 +26,9 @@
26 26 }
27 27
28 28 public function generate_level_1_gallery(Photo_List $photo_list, array $short_code, Base $module): string {
29 29 $photos = $photo_list->photos;
30 - if (!is_array($photos) || empty($photos)) {
30 + if (empty($photos)) {
31 31 return '';
32 32 }
33 33
34 34 $short_code = array_merge($this->common_parameters, $short_code);
@@ -33,14 +33,8 @@
33 33
34 34 $short_code = array_merge($this->common_parameters, $short_code);
35 35
36 36 global $photonic_wp_slide_adjustment, $photonic_slideshow_interval;
37 - $data_attr = '';
38 - foreach ($short_code as $key => $value) {
39 - if (in_array($key, ['speed', 'timeout', 'fx', 'pause', 'layout', 'strip-style', 'controls', 'columns'], true)) {
40 - $data_attr .= 'data-photonic-' . $key . '="' . esc_attr($value) . '" ';
41 - }
42 - }
43 37
44 38 $style = esc_attr(empty($short_code['style']) ? (empty($short_code['layout']) ? '' : $short_code['layout']) : $short_code['style']);
45 39 $title_position = esc_attr(empty($short_code['title_position']) ? $photo_list->title_position : $short_code['title_position']);
46 40
@@ -82,9 +76,9 @@
82 76 // $ret .= $this->get_thumbnails($photos, $module);
83 77 $ret .= $this->get_secondary_slider($photos, $module);
84 78 }
85 79
86 - $ret .= "<div id='photonic-slideshow-{$module->provider}-{$module->gallery_index}' class='photonic-slideshow splide {$style} title-display-{$title_position} photonic-slideshow-" . esc_attr($photonic_wp_slide_adjustment) . "' data-splide='$splide_options'>\n";
80 + $ret .= "<div id='photonic-slideshow-$module->provider-$module->gallery_index' class='photonic-slideshow splide $style title-display-$title_position photonic-slideshow-" . esc_attr($photonic_wp_slide_adjustment) . "' data-splide='$splide_options'>\n";
87 81
88 82 $ret .= "\t<div class='splide__track'>\n";
89 83 // $ret .= "\t\t<ul class='photonic-slideshow-content splide__list' $data_attr>\n";
90 84 $ret .= "\t\t<ul class='photonic-slideshow-content splide__list'>\n";
@@ -102,17 +96,11 @@
102 96 'alt' => $alt,
103 97 ];
104 98
105 99 $title = $this->get_title($title, $titles, $short_code);
106 -/* if ('desc' === $short_code['caption'] || ('title-desc' === $short_code['caption'] && empty($title)) || ('desc-title' === $short_code['caption'] && !empty($description))) {
107 - $title = $description;
108 - }
109 - elseif (('desc-title' === $short_code['caption'] && empty($title)) || 'none' === $short_code['caption']) {
110 - $title = '';
111 - }*/
112 100
113 101 $ret .= "\t\t\t\t<div class='splide__slide__container'>\n";
114 - if (!isset($photo->video)) {
102 + if (empty($photo->video)) {
115 103 if ('tooltip' === $title_position) {
116 104 $tooltip = 'data-photonic-tooltip="' . $title . '" ';
117 105 }
118 106 else {
@@ -117,9 +105,9 @@
117 105 }
118 106 else {
119 107 $tooltip = '';
120 108 }
121 - $ret .= "\t\t\t\t<img src='" . esc_url($photo->main_image) . "' alt='{$alt}' title='" . (('regular' === $title_position || 'tooltip' === $title_position) ? $title : '') . "' $tooltip id='photonic-slideshow-{$module->provider}-{$module->gallery_index}-{$photo->id}' />\n";
109 + $ret .= "\t\t\t\t<img src='" . esc_url($photo->main_image) . "' alt='$alt' title='" . (('regular' === $title_position || 'tooltip' === $title_position) ? $title : '') . "' $tooltip id='photonic-slideshow-$module->provider-$module->gallery_index-$photo->id' />\n";
122 110 }
123 111 else {
124 112 $ret .= "\t\t\t\t<video controls loop><source src='" . esc_url($photo->video) . "' type='video/mp4'><img src='" . esc_url($photo->main_image) . "' alt=''></video>";
125 113 }
@@ -170,9 +158,9 @@
170 158 ],
171 159 ];
172 160 $thumb_options = esc_attr(wp_json_encode($thumb_options));
173 161
174 - $ret = "<div id='photonic-slideshow-{$module->provider}-{$module->gallery_index}-thumbs' class='photonic-slideshow-thumbs splide thumbnails js-thumbnails' data-splide='$thumb_options'>\n";
162 + $ret = "<div id='photonic-slideshow-$module->provider-$module->gallery_index-thumbs' class='photonic-slideshow-thumbs splide thumbnails js-thumbnails' data-splide='$thumb_options'>\n";
175 163 $ret .= "\t<div class='splide__track'>\n";
176 164 $ret .= "\t<ul class='splide__list'>\n";
177 165 foreach ($photos as $photo) {
178 166 $ret .= "\t\t<li class='splide__slide' tabindex='0'>\n";