← All changes
|
modules/tiled-gallery/tiled-gallery/templates/partials/item.php
+10
-3
12.7.3
→
16.3
View file →
| @@ -1,14 +1,21 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Handles more photo metadata. |
| 4 | 4 | * |
| 5 | + * @html-template Jetpack_Tiled_Gallery_Layout::partial | |
| 5 | 6 | * @package jetpack |
| 6 | 7 | */ |
| 7 | 8 | |
| 8 | -$item = $context['item']; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable | |
| 9 | -$add_link = 'none' !== $this->link; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable | |
| 9 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | + exit( 0 ); | |
| 11 | +} | |
| 10 | 12 | |
| 13 | +// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- HTML template, let Phan handle it. | |
| 14 | + | |
| 15 | +$item = $context['item']; | |
| 16 | +$add_link = 'none' !== $this->link; | |
| 17 | + | |
| 11 | 18 | // We do this for accessibility. Titles without alt's break screen readers. |
| 12 | 19 | if ( empty( $item->image_alt ) && ! empty( $item->image_title ) ) { |
| 13 | 20 | $item->image_alt = $item->image_title; |
| 14 | 21 | } |
| @@ -25,9 +32,9 @@ | ||
| 25 | 32 | <meta itemprop="width" content="<?php echo esc_attr( $item->image->width ); ?>"> |
| 26 | 33 | <meta itemprop="height" content="<?php echo esc_attr( $item->image->height ); ?>"> |
| 27 | 34 | <img |
| 28 | 35 | class="<?php echo empty( $this->grayscale ) ? '' : 'grayscale'; ?>" |
| 29 | - <?php $this->partial( 'carousel-image-args', array( 'item' => $item ) ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable ?> | |
| 36 | + <?php $this->partial( 'carousel-image-args', array( 'item' => $item ) ); ?> | |
| 30 | 37 | src="<?php echo esc_url( $item->img_src ); ?>" |
| 31 | 38 | <?php echo $item->img_srcset ? 'srcset="' . esc_attr( $item->img_srcset ) . '"' : ''; ?> |
| 32 | 39 | width="<?php echo esc_attr( $item->image->width ); ?>" |
| 33 | 40 | height="<?php echo esc_attr( $item->image->height ); ?>" |