• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Files / extensions/blocks/podcast-player/templates/podcast-header.php


Lines:

1 to 75 of 75
<?php

/**
 * Podcast Header template.
 *
 * @package Jetpack
 */

namespace Automattic\Jetpack\Extensions\Podcast_Player;


/**
 * Template variables.
 *
 * @var array  $template_props
 * @var string $player_id
 * @var string $title
 * @var string $link
 * @var array  $primary_colors
 */


/**
 * 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( $cover ) ) : ?>
			<div class="jetpack-podcast-player__cover">
				<img class="jetpack-podcast-player__cover-image" src="<?php echo esc_url( $cover ); ?>" alt="" />
			</div>
		<?php endif; ?>

		<?php
    if ( $show_episode_title ) {
      render(
        'podcast-header-title',
        array(
          'player_id'      => $player_id,
          'title'          => $title,
          'link'           => $link,
          'track'          => $track,
          'primary_colors' => $primary_colors,
        )
      );
    }
    ?>
	</div>

	<?php
  if ( $show_episode_description && ! empty( $track ) && isset( $track['description'] ) ) :
    ?>
	<div
		id="<?php echo esc_attr( $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>
 

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      1 to 1 of 1
      • render() – Dynamic rendering of the block.

      Call hooks

      File name: extensions/blocks/podcast-player/templates/podcast-header.php
      Plugin ref: Jetpack
      Version: 9.2
      Deprecated?: No
      API Letters: B,E,P,T

      Related

      Published: 6 May 2020 | Last updated: 10 December 2020

      Primary Sidebar

      Information

      File name: extensions/blocks/podcast-player/templates/podcast-header.php
      Plugin ref: Jetpack
      Version: 9.2
      Deprecated?: No
      API Letters: B,E,P,T

      extensions/blocks/podcast-player/templates

      Footer

      Jetpack a2z
      Jetpack a2z
      Jetpack a2z
      WordPress 5.6
      WordPress a2z
      WordPress core a2z
      Genesis Theme Framework a2z
      Jetpack a2z
      WordPress develop tests
      Easy Digital Downloads a2z
      WooCommerce a2z
      Yoast SEO a2z
      WordPress Blocks

      Site:  jetpack.wp-a2z.org
      © Copyright Jetpack a2z 2014-2021. All rights reserved.


      Website designed and developed by Herb Miller
      Proudly powered by WordPress and oik plugins

      • Home
      • Blog
      • Sitemap
      • Sites