post_title); } } if (empty($image_title)) { $image_title = esc_html(get_the_title()); } $image_url = !empty($item["image"]["url"]) ? esc_url($item["image"]["url"]) : esc_url(\Elementor\Utils::get_placeholder_image_src()); if ($type === "image") { if ($item["image_link_to_type"] === "custom" && !empty($item["link"]["url"])) { $link = esc_url($item["link"]["url"]); } elseif ($item["image_link_to_type"] === "file") { if ($settings["open_lightbox"] === "yes") { $link = esc_url($image_url); } else { $link = esc_url(get_attachment_link($item["image"]["id"])); } } echo '
'; if (!empty($link)) { echo ''; } echo '
'; $overlay_type = esc_attr($settings['overlay_type']); $animation_class = 'zlfms-overlay-animation-' . esc_attr($settings['overlay_animation']); if ($overlay_type === 'text') { echo '
'; echo esc_html($image_title); echo '
'; } elseif ($overlay_type === 'icon') { echo '
'; $icon = $settings['overlay_icon_choose']; if (!empty($icon['value'])) { echo ''; } echo '
'; } echo '
'; if (!empty($link)) { echo '
'; } echo '
'; // Closing swiper-slide } elseif ($type === "video") { $video_url = esc_url($item["video"]["url"]); $video_id = ""; $embed_url = ""; $matches = []; if (preg_match('/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/', $video_url, $matches)) { $video_id = $matches[1]; $embed_url = "https://www.youtube.com/embed/" . esc_attr($video_id); $video_type = "youtube"; } elseif (preg_match('/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/(?:\w+\/)?videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?))/', $video_url, $matches)) { $video_id = $matches[2]; $embed_url = "https://player.vimeo.com/video/" . esc_attr($video_id); $video_type = "vimeo"; } echo '
'; if (!empty($embed_url) && $settings["open_lightbox"] === "yes") { echo '
'; } else { echo ''; } echo '
'; if ($settings["show_play_icon"] === "yes") { $play_icon = $settings["play_icon"]; $icon_value = isset($play_icon['value']) ? esc_attr($play_icon['value']) : 'far fa-play-circle'; $icon_library = isset($play_icon['library']) ? esc_attr($play_icon['library']) : 'fa-solid'; echo '
'; } echo '
'; $overlay_type = esc_attr($settings['overlay_type']); $animation_class = 'zlfms-overlay-animation-' . esc_attr($settings['overlay_animation']); if ($overlay_type === 'text') { echo '
'; echo esc_html($image_title); echo '
'; } elseif ($overlay_type === 'icon') { echo '
'; $icon = $settings['overlay_icon_choose']; if (!empty($icon['value'])) { echo ''; } echo '
'; } echo (!empty($embed_url) && $settings["open_lightbox"] === "yes") ? '
' : ''; echo '
'; // Closing swiper-slide for video } } ?>
'true']); ?>
'true']); ?>
'; echo '
'; $overlay_type = esc_attr($settings['overlay_type']); $animation_class = 'zlfms-overlay-animation-' . esc_attr($settings['overlay_animation']); if ($overlay_type === 'text') { echo '
'; echo esc_html($image_title); echo '
'; } elseif ($overlay_type === 'icon') { echo '
'; $icon = $settings['overlay_icon_choose']; if (!empty($icon['value'])) { echo ''; } echo '
'; } echo '
'; echo '
'; // Closing swiper-slide } elseif ($type === "video") { $video_url = esc_url($item["video"]["url"]); $video_id = ""; $embed_url = ""; $matches = []; if (preg_match('/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/', $video_url, $matches)) { $video_id = $matches[1]; $embed_url = "https://www.youtube.com/embed/" . esc_attr($video_id); $video_type = "youtube"; } elseif (preg_match('/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/(?:\w+\/)?videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?))/', $video_url, $matches)) { $video_id = $matches[2]; $embed_url = "https://player.vimeo.com/video/" . esc_attr($video_id); $video_type = "vimeo"; } echo '
'; echo '
'; if ($settings["show_play_icon"] === "yes") { $play_icon = $settings["play_icon"]; $icon_value = isset($play_icon['value']) ? esc_attr($play_icon['value']) : 'far fa-play-circle'; $icon_library = isset($play_icon['library']) ? esc_attr($play_icon['library']) : 'fa-solid'; echo '
'; } echo '
'; $overlay_type = esc_attr($settings['overlay_type']); $animation_class = 'zlfms-overlay-animation-' . esc_attr($settings['overlay_animation']); if ($overlay_type === 'text') { echo '
'; echo esc_html($image_title); echo '
'; } elseif ($overlay_type === 'icon') { echo '
'; $icon = $settings['overlay_icon_choose']; if (!empty($icon['value'])) { echo ''; } echo '
'; } echo '
'; // Closing swiper-slide for video } } ?>