File: /www/wwwroot/claudiayancor.duckdns.org/wp-content/plugins/photonic/Lightboxes/Featherlight.php
<?php
namespace Photonic_Plugin\Lightboxes;
require_once 'Lightbox.php';
class Featherlight extends Lightbox {
protected function __construct() {
$this->library = 'featherlight';
parent::__construct();
$this->class = ['photonic-lb', 'photonic-featherlight'];
}
public function get_photo_attributes($photo_data, $module) {
$out = parent::get_photo_attributes($photo_data, $module);
$mime = (!empty($photo['mime']) ? $photo['mime'] : 'video/mp4');
if ('google' === $module->provider && empty($photo_data['video'])) {
return $out . " data-featherlight-type='image' ";
}
elseif ('google' === $module->provider && !empty($photo_data['video'])) {
return $out . " data-featherlight='" . esc_attr("<video class=\"photonic\" controls preload=\"none\"><source src=\"" . $photo_data['video'] . "\" type=\"" . $mime . "\">" . esc_html__('Your browser does not support HTML5 videos.', 'photonic') . "</video>") . "' data-featherlight-type='html'";
}
return $out . (!empty($photo_data['video'])
? " data-featherlight='" . esc_attr("<video class=\"photonic\" controls preload=\"none\"><source src=\"" . $photo_data['video'] . "\" type=\"" . $mime . "\">" . esc_html__('Your browser does not support HTML5 videos.', 'photonic') . "</video>") . "' data-featherlight-type='video'"
: '');
}
}