PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 2.3.8
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v2.3.8
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
automatic-youtube-gallery / public / templates / thumbnail.php

thumbnail.php in Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels 2.3.8, at public/templates/thumbnail.php

64 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Thumbnail
5 *
6 * @link https://plugins360.com
7 * @since 1.0.0
8 *
9 * @package Automatic_YouTube_Gallery
10 */
11
12 $single_video_page_url = ayg_get_single_video_url( $video, $attributes );
13 ?>
14
15 <div class="ayg-thumbnail" data-id="<?php echo esc_attr( $video->id ); ?>" data-title="<?php echo esc_attr( $video->title ); ?>" data-url="<?php echo esc_attr( $single_video_page_url ); ?>">
16 <div class="ayg-thumbnail-image-wrapper">
17 <?php
18 $image_src = '';
19
20 if ( isset( $video->thumbnails->default ) ) {
21 $image_src = $video->thumbnails->default->url;
22 }
23
24 // 4:3 ( default - 120x90, high - 480x360, standard - 640x480 )
25 if ( 75 == (int) $attributes['thumb_ratio'] ) {
26 if ( isset( $video->thumbnails->high ) ) {
27 $image_src = $video->thumbnails->high->url;
28 }
29 }
30
31 // 16:9 ( medium - 320x180, maxres - 1280x720 )
32 if ( 56.25 == (float) $attributes['thumb_ratio'] ) {
33 if ( isset( $video->thumbnails->medium ) ) {
34 $image_src = $video->thumbnails->medium->url;
35 }
36
37 if ( isset( $video->thumbnails->maxres ) ) {
38 $image_src = $video->thumbnails->maxres->url;
39 }
40 }
41 ?>
42 <img src="<?php echo esc_url( $image_src ); ?>" class="ayg-thumbnail-image" alt="<?php echo esc_attr( $video->title );?>" />
43
44 <svg class="ayg-icon ayg-thumbnail-icon-play" width="32" height="32" viewBox="0 0 32 32" fill="#fff" title="<?php esc_attr_e( 'Play', 'automatic-youtube-gallery' ); ?>" aria-label="<?php esc_attr_e( 'Play', 'automatic-youtube-gallery' ); ?>">
45 <path d="M16 0c-8.837 0-16 7.163-16 16s7.163 16 16 16 16-7.163 16-16-7.163-16-16-16zM16 29c-7.18 0-13-5.82-13-13s5.82-13 13-13 13 5.82 13 13-5.82 13-13 13zM12 9l12 7-12 7z"></path>
46 </svg>
47
48 <div class="ayg-thumbnail-active" style="display: none;"><?php esc_html_e( 'active', 'automatic-youtube-gallery' ); ?></div>
49 </div>
50
51 <div class="ayg-thumbnail-caption">
52 <?php if ( ! empty( $attributes['thumb_title'] ) ) : ?>
53 <div class="ayg-thumbnail-title"><?php echo esc_html( ayg_trim_words( $video->title, (int) $attributes['thumb_title_length'] ) ); ?></div>
54 <?php endif; ?>
55
56 <?php if ( ! empty( $attributes['thumb_excerpt'] ) && ! empty( $video->description ) ) : ?>
57 <div class="ayg-thumbnail-excerpt"><?php echo wp_kses_post( ayg_trim_words( $video->description, (int) $attributes['thumb_excerpt_length'] ) ); ?></div>
58 <?php endif; ?>
59
60 <?php if ( ! empty( $attributes['player_description'] ) && ! empty( $video->description ) ) : ?>
61 <div class="ayg-thumbnail-description" style="display: none;"><?php echo wp_kses_post( ayg_get_player_description( $video ) ); ?></div>
62 <?php endif; ?>
63 </div>
64 </div>