fix: fall back to placeholder art when a cover attachment is gone
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
9 files changed
+80
-23
No files matched your search
@@ -29,8 +29,11 @@ if ( is_wp_error( $chrnx_terms ) || empty( $chrnx_terms ) ) {
|
||||
<a class="chrnx-release-card__link" href="<?php echo esc_url( $chrnx_link ); ?>">
|
||||
<?php endif; ?>
|
||||
<span class="chrnx-release-card__art">
|
||||
<?php if ( $chrnx_cover > 0 ) : ?>
|
||||
<?php echo wp_get_attachment_image( $chrnx_cover, 'chrnx-card', false, array( 'class' => 'chrnx-release-card__cover' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php
|
||||
$chrnx_cover_markup = $chrnx_cover > 0 ? wp_get_attachment_image( $chrnx_cover, 'chrnx-card', false, array( 'class' => 'chrnx-release-card__cover' ) ) : '';
|
||||
?>
|
||||
<?php if ( '' !== $chrnx_cover_markup ) : ?>
|
||||
<?php echo $chrnx_cover_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php else : ?>
|
||||
<?php echo chrnx_get_topic_portrait_markup( 'placeholder-release', '', 'chrnx-release-card__fallback' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in new issue
Block a user