| 1 |
<figure class="mgl-item"<?php echo wp_kses_post( $attributes ) ?>> |
| 2 |
<div class="mgl-icon"> |
| 3 |
<div class="mgl-img-container"> |
| 4 |
<?php if ( !$isPreview && $linkUrl ): ?> |
| 5 |
<a href="<?php echo esc_url( $linkUrl ) ?>"> |
| 6 |
<?= |
| 7 |
wp_kses( $imgSrc, [ |
| 8 |
'img' => [ |
| 9 |
'src' => true, |
| 10 |
'srcset' => true, |
| 11 |
'sizes' => true, |
| 12 |
'class' => true, |
| 13 |
'id' => true, |
| 14 |
'width' => true, |
| 15 |
'height' => true, |
| 16 |
'alt' => true, |
| 17 |
'align' => true, |
| 18 |
] |
| 19 |
] |
| 20 |
); |
| 21 |
?> |
| 22 |
</a> |
| 23 |
<?php else: ?> |
| 24 |
<?= |
| 25 |
wp_kses( $imgSrc, [ |
| 26 |
'img' => [ |
| 27 |
'src' => true, |
| 28 |
'srcset' => true, |
| 29 |
'sizes' => true, |
| 30 |
'class' => true, |
| 31 |
'id' => true, |
| 32 |
'width' => true, |
| 33 |
'height' => true, |
| 34 |
'alt' => true, |
| 35 |
'align' => true, |
| 36 |
] |
| 37 |
] |
| 38 |
); |
| 39 |
?> |
| 40 |
<?php endif; ?> |
| 41 |
</div> |
| 42 |
</div> |
| 43 |
<?php if ( $caption ): ?> |
| 44 |
<figcaption class="mgl-caption"> |
| 45 |
<p><?php echo wp_kses_post( $caption ) ?></p> |
| 46 |
</figcaption> |
| 47 |
<?php endif; ?> |
| 48 |
</figure> |
| 49 |
|