PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.1.3
Jetpack – WP Security, Backup, Speed, & Growth v16.1.3
12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 14.4.2 All 500 releases
jetpack / extensions / blocks / podcast-player / templates / podcast-header.php
podcast-header.php
71 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Podcast Header template.
4 *
5 * @html-template Automattic\Jetpack\Extensions\Podcast_Player\render
6 * @package automattic/jetpack
7 */
8
9 // phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- HTML template, let Phan handle it.
10
11 namespace Automattic\Jetpack\Extensions\Podcast_Player;
12
13 /**
14 * Template variables.
15 *
16 * @var array $template_props
17 */
18
19 /**
20 * Block attributes.
21 */
22 $attributes = (array) $template_props['attributes']; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
23 $show_cover_art = (bool) $attributes['showCoverArt'];
24 $show_episode_title = (bool) $attributes['showEpisodeTitle'];
25 $show_episode_description = (bool) $attributes['showEpisodeDescription'];
26
27 // Current track.
28 $tracks = $template_props['tracks'];
29 $track = ( is_array( $tracks ) && ! empty( $tracks ) ) ? $tracks[0] : array();
30 ?>
31
32 <div class="jetpack-podcast-player__header">
33 <div class="jetpack-podcast-player__current-track-info">
34 <?php if ( $show_cover_art && isset( $template_props['cover'] ) ) : ?>
35 <div class="jetpack-podcast-player__cover">
36 <img class="jetpack-podcast-player__cover-image" src="<?php echo esc_url( $template_props['cover'] ); ?>" alt="" />
37 </div>
38 <?php endif; ?>
39
40 <?php
41 if ( $show_episode_title ) {
42 render(
43 'podcast-header-title',
44 array(
45 'player_id' => $template_props['player_id'],
46 'title' => $template_props['title'],
47 'link' => $template_props['link'],
48 'track' => $track,
49 'primary_colors' => $template_props['primary_colors'],
50 )
51 );
52 }
53 ?>
54 </div>
55
56 <?php
57 if ( $show_episode_description && ! empty( $track ) && isset( $track['description'] ) ) :
58 ?>
59 <div
60 id="<?php echo esc_attr( $template_props['player_id'] ); ?>__track-description"
61 class="jetpack-podcast-player__track-description"
62 >
63 <?php echo esc_html( $track['description'] ); ?>
64 </div>
65 <?php endif; ?>
66
67 <div class="jetpack-podcast-player__audio-player">
68 <div class="jetpack-podcast-player--audio-player-loading"></div>
69 </div>
70 </div>
71