# jetpack/12.7.3/modules/tiled-gallery/tiled-gallery/templates/partials/item.php

Jetpack – WP Security, Backup, Speed, &amp; Growth, version 12.7.3. 52 lines.

- Page: https://pluginprobe.com/plugins/jetpack/12.7.3/code/modules/tiled-gallery/tiled-gallery/templates/partials/item.php
- Raw: https://pluginprobe.com/plugins/jetpack/12.7.3/raw/modules/tiled-gallery/tiled-gallery/templates/partials/item.php
- Modified: 2023-08-28T13:48:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetpack/12.7.3/code/modules/tiled-gallery/tiled-gallery/templates/partials/item.php#L10-L20`.

```php
<?php
/**
 * Handles more photo metadata.
 *
 * @package jetpack
 */

$item     = $context['item']; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
$add_link = 'none' !== $this->link; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable

// We do this for accessibility.  Titles without alt's break screen readers.
if ( empty( $item->image_alt ) && ! empty( $item->image_title ) ) {
	$item->image_alt = $item->image_title;
}
?>
<div class="tiled-gallery-item
<?php
if ( isset( $item->size ) ) {
	echo esc_attr( " tiled-gallery-item-$item->size" );}
?>
" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
	<?php if ( $add_link ) : ?>
	<a href="<?php echo esc_url( $item->link ); ?>" border="0" itemprop="url">
	<?php endif; ?>
		<meta itemprop="width" content="<?php echo esc_attr( $item->image->width ); ?>">
		<meta itemprop="height" content="<?php echo esc_attr( $item->image->height ); ?>">
		<img
			class="<?php echo empty( $this->grayscale ) ? '' : 'grayscale'; ?>"
			<?php $this->partial( 'carousel-image-args', array( 'item' => $item ) ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable ?>
			src="<?php echo esc_url( $item->img_src ); ?>"
			<?php echo $item->img_srcset ? 'srcset="' . esc_attr( $item->img_srcset ) . '"' : ''; ?>
			width="<?php echo esc_attr( $item->image->width ); ?>"
			height="<?php echo esc_attr( $item->image->height ); ?>"
			loading="lazy"
			data-original-width="<?php echo esc_attr( $item->image->width ); ?>"
			data-original-height="<?php echo esc_attr( $item->image->height ); ?>"
			itemprop="http://schema.org/image"
			title="<?php echo esc_attr( $item->image_title ); ?>"
			alt="<?php echo esc_attr( $item->image_alt ); ?>"
			style="width: <?php echo esc_attr( $item->image->width ); ?>px; height: <?php echo esc_attr( $item->image->height ); ?>px;"
		/>
	<?php if ( $add_link ) : ?>
	</a>
	<?php endif; ?>

	<?php if ( trim( $item->image->post_excerpt ) ) : ?>
		<div class="tiled-gallery-caption" itemprop="caption description">
			<?php echo wptexturize( $item->image->post_excerpt ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
		</div>
	<?php endif; ?>
</div>

```
