PluginProbe
YayMail – WooCommerce Email Customizer / trunk
YayMail – WooCommerce Email Customizer vtrunk
4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 3.4.2 3.4.3 All 55 releases
yaymail / templates / elements / hook.php

hook.php in YayMail – WooCommerce Email Customizer trunk, at templates/elements/hook.php

34 lines 953 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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