PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.33
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.33
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 / Components / Single_Photo.php

Single_Photo.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.33, at Components/Single_Photo.php

46 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Photonic_Plugin\Components;
4
5 use Photonic_Plugin\Core\Photonic;
6 use Photonic_Plugin\Layouts\Core_Layout;
7 use Photonic_Plugin\Platforms\Base;
8
9 /**
10 * Class Single_Photo
11 * Represents a standalone photo in Photonic. This can be displayed currently by Flickr, Instagram and Zenfolio. The photo shows up
12 * as a full-width image and caption, along with a header if available. The photo can be linked to the source.
13 * This is a "Printable" element - it may be returned in the <code>get_gallery_images</code> for the corresponding platform.
14 *
15 * @package Photonic_Plugin\Components
16 */
17 class Single_Photo implements Printable {
18 public $src = '';
19 public $href = '';
20 public $title = '';
21 public $caption = '';
22
23 /**
24 * Single_Photo constructor.
25 *
26 * @param string $src
27 * @param string $href
28 * @param string $title
29 * @param string $caption
30 */
31 public function __construct($src, $href, $title, $caption) {
32 $this->src = $src;
33 $this->href = $href;
34 $this->title = $title;
35 $this->caption = $caption;
36 }
37
38 public function html(Base $module, ?Core_Layout $layout = null, $print = false): string {
39 $ret = $layout->generate_single_photo_markup($this, $module);
40 if ($print) {
41 echo wp_kses($ret, Photonic::$safe_tags);
42 }
43 return wp_kses($ret, Photonic::$safe_tags);
44 }
45 }
46