| 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 |
'loading' => true, |
| 12 |
'sizes' => true, |
| 13 |
'class' => true, |
| 14 |
'id' => true, |
| 15 |
'width' => true, |
| 16 |
'height' => true, |
| 17 |
'alt' => true, |
| 18 |
'align' => true, |
| 19 |
] |
| 20 |
] |
| 21 |
); |
| 22 |
?> |
| 23 |
</a> |
| 24 |
<?php else: ?> |
| 25 |
<?= |
| 26 |
wp_kses( $imgSrc, [ |
| 27 |
'img' => [ |
| 28 |
'src' => true, |
| 29 |
'srcset' => true, |
| 30 |
'loading' => true, |
| 31 |
'sizes' => true, |
| 32 |
'class' => true, |
| 33 |
'id' => true, |
| 34 |
'width' => true, |
| 35 |
'height' => true, |
| 36 |
'alt' => true, |
| 37 |
'align' => true, |
| 38 |
] |
| 39 |
] |
| 40 |
); |
| 41 |
?> |
| 42 |
<?php endif; ?> |
| 43 |
</div> |
| 44 |
</div> |
| 45 |
<?php if ( !empty( $caption ) ): ?> |
| 46 |
<figcaption class="mgl-caption"> |
| 47 |
<p><?php echo wp_kses($caption, [ |
| 48 |
'strong' => [], // Bold |
| 49 |
'b' => [], // Bold alternative |
| 50 |
'em' => [], // Italic |
| 51 |
'i' => [] // Italic alternative |
| 52 |
]) ?></p> |
| 53 |
</figcaption> |
| 54 |
<?php endif; ?> |
| 55 |
</figure> |
| 56 |
|