| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
use YayMail\Utils\TemplateHelpers; |
| 5 |
|
| 6 |
if ( empty( $args['element'] ) ) { |
| 7 |
return; |
| 8 |
} |
| 9 |
|
| 10 |
$element = $args['element']; |
| 11 |
$data = $element['data']; |
| 12 |
|
| 13 |
$content_style = TemplateHelpers::get_style( |
| 14 |
[ |
| 15 |
'background-color' => $data['background_color'], |
| 16 |
'color' => $data['text_color'], |
| 17 |
'font-family' => isset( $data['font_family'] ) ? $data['font_family'] : '', |
| 18 |
'padding' => TemplateHelpers::get_spacing_value( isset( $data['padding'] ) ? $data['padding'] : [] ), |
| 19 |
'text-align' => yaymail_get_text_align(), |
| 20 |
] |
| 21 |
); |
| 22 |
|
| 23 |
|
| 24 |
if ( ! empty( $data['hook_shortcode'] ) ) { |
| 25 |
ob_start(); |
| 26 |
?> |
| 27 |
<div style="<?php echo esc_attr( $content_style ); ?>"><?php yaymail_kses_post_e( do_shortcode( $data['hook_shortcode'] ) ); ?></div> |
| 28 |
<?php |
| 29 |
$element_content = ob_get_clean(); |
| 30 |
|
| 31 |
TemplateHelpers::wrap_element_content( $element_content, $element ); |
| 32 |
} |
| 33 |
?> |
| 34 |
|