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
← All changes | public/templates/theme-classic.php +58 -41 2.9.1 → 2.3.8 View file →
@@ -8,14 +8,21 @@
8 8 *
9 9 * @package Automatic_YouTube_Gallery
10 10 */
11 11
12 -$player_width = ! empty( $attributes['player_width'] ) ? (int) $attributes['player_width'] . 'px' : '100%';
13 -$columns = (int) $attributes['columns'];
12 +$player_ratio = ! empty( $attributes['player_ratio'] ) ? (float) $attributes['player_ratio'] : '56.25';
14 13
15 14 $params = array(
16 15 'uid' => sanitize_text_field( $attributes['uid'] ),
16 + 'autoplay' => (int) $attributes['autoplay'],
17 17 'loop' => (int) $attributes['loop'],
18 + 'muted' => (int) $attributes['muted'],
19 + 'controls' => (int) $attributes['controls'],
20 + 'modestbranding' => (int) $attributes['modestbranding'],
21 + 'cc_load_policy' => (int) $attributes['cc_load_policy'],
22 + 'iv_load_policy' => (int) $attributes['iv_load_policy'],
23 + 'hl' => sanitize_text_field( $attributes['hl'] ),
24 + 'cc_lang_pref' => sanitize_text_field( $attributes['cc_lang_pref'] ),
18 25 'autoadvance' => (int) $attributes['autoadvance'],
19 26 'player_title' => (int) $attributes['player_title'],
20 27 'player_description' => (int) $attributes['player_description']
21 28 );
@@ -20,48 +27,58 @@
20 27 'player_description' => (int) $attributes['player_description']
21 28 );
22 29
23 30 $featured = $videos[0]; // Featured Video
31 +?>
24 32
25 -$params = apply_filters( 'ayg_theme_classic_params', $params, $attributes );
26 -?>
27 -<div class="automatic-youtube-gallery ayg">
28 - <?php the_ayg_search_form( $attributes ); ?>
29 - <ayg-theme-classic id="ayg-<?php echo esc_attr( $attributes['uid'] ); ?>" class="ayg-theme ayg-theme-classic" data-params="<?php echo esc_attr( wp_json_encode( $params ) ); ?>">
30 - <div class="ayg-player">
31 - <div class="ayg-player-container" style="max-width: <?php echo $player_width; ?>;">
32 - <?php
33 - unset( $attributes['loop'] );
34 - the_ayg_player( $featured, $attributes );
35 - ?>
36 - </div>
37 - <div class="ayg-player-caption">
38 - <?php if ( ! empty( $attributes['player_title'] ) ) : ?>
39 - <h2 class="ayg-player-title"><?php echo esc_html( $featured->title ); ?></h2>
40 - <?php endif; ?>
41 - <?php if ( ! empty( $attributes['player_description'] ) ) : ?>
42 - <ayg-description class="ayg-player-description"><?php if ( ! empty( $featured->description ) ) echo wp_kses_post( ayg_get_player_description( $featured, $attributes ) ); ?></ayg-description>
43 - <?php endif; ?>
44 - </div>
33 +<div id="ayg-<?php echo esc_attr( $attributes['uid'] ); ?>" class="ayg ayg-theme-classic" data-params='<?php echo wp_json_encode( $params ); ?>'>
34 + <!-- Player -->
35 + <div class="ayg-player">
36 + <div class="ayg-player-wrapper" style="padding-bottom: <?php echo (float) $player_ratio; ?>%;">
37 + <?php
38 + $tag = 'div';
39 + if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
40 + $tag = 'iframe';
41 + }
42 +
43 + printf(
44 + '<%1$s class="ayg-player-iframe" width="100%%" height="100%%" src="%2$s/embed/%3$s" data-id="%3$s" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></%1$s>',
45 + $tag,
46 + ayg_get_youtube_domain(),
47 + esc_attr( $featured->id )
48 + );
49 + ?>
45 50 </div>
46 - <div class="ayg-videos ayg-gallery ayg-row">
47 - <?php foreach ( $videos as $index => $video ) :
48 - $classes = array();
49 - $classes[] = 'ayg-video';
50 - $classes[] = 'ayg-video-' . $video->id;
51 - $classes[] = 'ayg-col';
52 - $classes[] = 'ayg-col-' . $columns;
53 - if ( $columns > 3 ) $classes[] = 'ayg-col-sm-3';
54 - if ( $columns > 2 ) $classes[] = 'ayg-col-xs-2';
55 51
56 - if ( $video->id == $featured->id ) {
57 - $classes[] = 'ayg-active';
58 - }
59 - ?>
60 - <div class="<?php echo implode( ' ', $classes ); ?>">
61 - <?php the_ayg_gallery_thumbnail( $video, $attributes ); ?>
62 - </div>
63 - <?php endforeach; ?>
52 + <div class="ayg-player-caption">
53 + <?php if ( ! empty( $attributes['player_title'] ) ) : ?>
54 + <h2 class="ayg-player-title"><?php echo esc_html( $featured->title ); ?></h2>
55 + <?php endif; ?>
56 +
57 + <?php if ( ! empty( $attributes['player_description'] ) ) : ?>
58 + <div class="ayg-player-description"><?php if ( ! empty( $featured->description ) ) echo wp_kses_post( ayg_get_player_description( $featured ) ); ?></div>
59 + <?php endif; ?>
64 60 </div>
65 - <?php the_ayg_pagination( $attributes ); ?>
66 - </ayg-theme-classic>
61 + </div>
62 +
63 + <!-- Gallery -->
64 + <div class="ayg-gallery ayg-row">
65 + <?php foreach ( $videos as $index => $video ) :
66 + $classes = array();
67 + $classes[] = 'ayg-item';
68 + $classes[] = 'ayg-item-' . $video->id;
69 + $classes[] = 'ayg-col';
70 + $classes[] = 'ayg-col-' . (int) $attributes['columns'];
71 +
72 + if ( $video->id == $featured->id ) {
73 + $classes[] = 'ayg-active';
74 + }
75 + ?>
76 + <div class="<?php echo implode( ' ', $classes ); ?>">
77 + <?php the_ayg_gallery_thumbnail( $video, $attributes ); ?>
78 + </div>
79 + <?php endforeach; ?>
80 + </div>
81 +
82 + <!-- Pagination -->
83 + <?php the_ayg_pagination( $attributes ); ?>
67 84 </div>