← All changes
|
modules/tiled-gallery/tiled-gallery/templates/rectangular-layout.php
+11
-4
12.2.3
→
16.3-a.7
View file →
| @@ -1,12 +1,19 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Rectangular layout Tiled Gallery template. |
| 4 | 4 | * |
| 5 | + * @html-template Jetpack_Tiled_Gallery_Layout::template | |
| 5 | 6 | * @package automattic/jetpack |
| 6 | 7 | */ |
| 7 | 8 | |
| 8 | -foreach ( $context['rows'] as $row ) : // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable | |
| 9 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | + exit( 0 ); | |
| 11 | +} | |
| 12 | + | |
| 13 | +// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- HTML template, let Phan handle it. | |
| 14 | + | |
| 15 | +foreach ( $context['rows'] as $row ) : | |
| 9 | 16 | ?> |
| 10 | 17 | <div |
| 11 | 18 | class="gallery-row" |
| 12 | 19 | style="width: <?php echo esc_attr( $row->width ); ?>px; height: <?php echo esc_attr( $row->height ); ?>px;" |
| @@ -21,14 +28,14 @@ | ||
| 21 | 28 | data-original-width="<?php echo esc_attr( $group->width ); ?>" |
| 22 | 29 | data-original-height="<?php echo esc_attr( $group->height ); ?>" |
| 23 | 30 | > |
| 24 | 31 | <?php |
| 25 | - foreach ( $group->items( $context['needs_attachment_link'], $context['grayscale'] ) as $item ) : // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable | |
| 26 | - $this->partial( // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable | |
| 32 | + foreach ( $group->items( $context['needs_attachment_link'], $context['grayscale'] ) as $item ) : | |
| 33 | + $this->partial( | |
| 27 | 34 | 'item', |
| 28 | 35 | array( |
| 29 | 36 | 'item' => $item, |
| 30 | - 'link' => $context['link'], // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable | |
| 37 | + 'link' => $context['link'], | |
| 31 | 38 | ) |
| 32 | 39 | ); |
| 33 | 40 | ?> |
| 34 | 41 | <?php endforeach; ?> |