CoreFiles by mySites.guru
featured-image.php43 lines, 883 bytes, from wordpress-5.4.21.zip
Raw History Compare with 5.4.20
md5
86778d8df0823289a4e29213d7939505
sha1
811fbca07c196cf198de62a78337eb8635a393aa
sha256
db94a35bf686f4d8d36307577bfff0c15bef94bbb20db6d756ad79190eb88efd
<?php
/**
 * Displays the featured image
 *
 * @package WordPress
 * @subpackage Twenty_Twenty
 * @since Twenty Twenty 1.0
 */

if ( has_post_thumbnail() && ! post_password_required() ) {

	$featured_media_inner_classes = '';

	// Make the featured media thinner on archive pages.
	if ( ! is_singular() ) {
		$featured_media_inner_classes .= ' medium';
	}
	?>

	<figure class="featured-media">

		<div class="featured-media-inner section-inner<?php echo $featured_media_inner_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">

			<?php
			the_post_thumbnail();

			$caption = get_the_post_thumbnail_caption();

			if ( $caption ) {
				?>

				<figcaption class="wp-caption-text"><?php echo esc_html( $caption ); ?></figcaption>

				<?php
			}
			?>

		</div><!-- .featured-media-inner -->

	</figure><!-- .featured-media -->

	<?php
}

The same content is in 38 releases, WordPress 5.4-beta1 to 5.4.26. See them all, or every version of this file.