blob: b6167df2fc7d7360646019917b84bcda2eb3a856 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
<?php
/**
* Podcast Header template.
*
* @package automattic/jetpack
*/
namespace Automattic\Jetpack\Extensions\Podcast_Player;
/**
* Template variables.
*
* @var array $template_props
*/
/**
* Block attributes.
*/
$attributes = (array) $template_props['attributes']; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
$show_cover_art = (bool) $attributes['showCoverArt'];
$show_episode_title = (bool) $attributes['showEpisodeTitle'];
$show_episode_description = (bool) $attributes['showEpisodeDescription'];
// Current track.
$tracks = $template_props['tracks'];
$track = ( is_array( $tracks ) && ! empty( $tracks ) ) ? $tracks[0] : array();
?>
<div class="jetpack-podcast-player__header">
<div class="jetpack-podcast-player__current-track-info">
<?php if ( $show_cover_art && isset( $template_props['cover'] ) ) : ?>
<div class="jetpack-podcast-player__cover">
<img class="jetpack-podcast-player__cover-image" src="<?php echo esc_url( $template_props['cover'] ); ?>" alt="" />
</div>
<?php endif; ?>
<?php
if ( $show_episode_title ) {
render(
'podcast-header-title',
array(
'player_id' => $template_props['player_id'],
'title' => $template_props['title'],
'link' => $template_props['link'],
'track' => $track,
'primary_colors' => $template_props['primary_colors'],
)
);
}
?>
</div>
<?php
if ( $show_episode_description && ! empty( $track ) && isset( $track['description'] ) ) :
?>
<div
id="<?php echo esc_attr( $template_props['player_id'] ); ?>__track-description"
class="jetpack-podcast-player__track-description"
>
<?php echo esc_html( $track['description'] ); ?>
</div>
<?php endif; ?>
<div class="jetpack-podcast-player__audio-player">
<div class="jetpack-podcast-player--audio-player-loading"></div>
</div>
</div>
|