PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.36
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.36
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 2.44 All 141 releases
photonic / Lightboxes / PhotoSwipe5.php

PhotoSwipe5.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.36, at Lightboxes/PhotoSwipe5.php

32 lines 848 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Photonic_Plugin\Lightboxes;
4
5 use Photonic_Plugin\Lightboxes\Features\Show_Videos_Inline;
6 use Photonic_Plugin\Platforms\Base;
7
8 require_once 'Lightbox.php';
9 require_once 'Features/Show_Videos_Inline.php';
10
11 class PhotoSwipe5 extends Lightbox {
12 use Show_Videos_Inline;
13
14 protected function __construct() {
15 $this->library = 'photoswipe5';
16 parent::__construct();
17 }
18
19 public function get_photo_attributes(array $photo_data, Base $module): array {
20 $out = parent::get_photo_attributes($photo_data, $module);
21 if (!empty($photo_data['height']) && !empty($photo_data['width'])) {
22 $out['data-pswp-height'] = $photo_data['height'];
23 $out['data-pswp-width'] = $photo_data['width'];
24 }
25
26 if (!empty($photo_data['video'])) {
27 $out['data-html5-href'] = $photo_data['video'];
28 }
29 return $out;
30 }
31 }
32