| 1 |
<?php |
| 2 |
|
| 3 |
//extract styles & classes |
| 4 |
extract($extra_attr); |
| 5 |
?> |
| 6 |
|
| 7 |
<div class="<?php echo esc_attr( $wrapper_class ); ?>" <?php if ( !empty($wrapper_style) ) { ?> style="<?php echo esc_attr($wrapper_style); ?>" <?php } ?>> |
| 8 |
<?php if ($attributes['linkTo'] == 'post'){ ?> |
| 9 |
<a href="<?php the_permalink(); ?>" class="<?php echo esc_attr( $block_name ); ?>__link"> |
| 10 |
<?php } ?> |
| 11 |
<div class="<?php echo esc_attr( $block_name ); ?>__image" style="background-image: url(<?php echo esc_url(get_the_post_thumbnail_url($current_post, $imageSize))?>);"></div> |
| 12 |
<div class="<?php echo esc_attr($foreground_class);?>" |
| 13 |
<?php if ( !empty($foreground_style) ) { ?> style="<?php echo esc_attr($foreground_style);?> " <?php } ?> |
| 14 |
></div> |
| 15 |
<?php if ($attributes['linkTo'] == 'post'){ ?> |
| 16 |
</a> |
| 17 |
<?php } ?> |
| 18 |
<div class="<?php echo esc_attr($content_container_class);?>" |
| 19 |
<?php if ( !empty($content_container_style) ) { ?> style="<?php echo esc_attr($content_container_style);?>"<?php }?> |
| 20 |
> |
| 21 |
<?php echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 22 |
</div> |
| 23 |
</div> |
| 24 |
|