Files
chrnxandClaude Opus 5 49047f1337 feat: link a podcast show to where it is heard
Releases already had platform links; shows had none, so the Podcasts
page could not point at Spotify or Apple. chrnx_show terms take a
Spotify, Apple Podcasts and RSS URL now, rendered above the latest
episode and only when a URL exists.

The platform helper takes its definitions as an argument rather than
always reading the release set: a podcast lives on Apple Podcasts, not
Apple Music, and labelling it wrong would send people to the wrong
service.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 20:21:01 -05:00

24 lines
978 B
PHP

<?php
/**
* Show Links block render.
*
* @package CHRNX
*/
// A named show wins; otherwise fall back to the show archive being viewed.
$chrnx_slug = chrnx_validate_editorial_term_slug( $attributes['show'] ?? '', 'chrnx_show' );
$chrnx_term = '' !== $chrnx_slug ? get_term_by( 'slug', $chrnx_slug, 'chrnx_show' ) : get_queried_object();
if ( ! $chrnx_term instanceof WP_Term || 'chrnx_show' !== $chrnx_term->taxonomy ) {
return;
}
$chrnx_links = chrnx_get_show_links( $chrnx_term->term_id );
if ( empty( $chrnx_links ) ) {
return;
}
?>
<div <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-show-links' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<p class="chrnx-show-links__label"><?php echo esc_html__( 'Listen on', 'chrnx' ); ?></p>
<?php echo chrnx_get_platform_links_markup( $chrnx_links, 'chrnx-platform-links', chrnx_get_show_platforms() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>