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 / element-wrapper.php

element-wrapper.php in YayMail – WooCommerce Email Customizer trunk, at templates/elements/element-wrapper.php

73 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use YayMail\Utils\TemplateHelpers;
4
5 extract( isset( $args ) ? $args : [] );
6
7 if ( empty( $element ) ) {
8 return;
9 }
10
11 if ( ! isset( $content_html ) ) {
12 $content_html = '';
13 }
14
15 if ( empty( $wrapper_style ) ) {
16 $wrapper_style = '';
17 }
18
19 $yaymail_settings = yaymail_settings();
20 $container_direction = yaymail_get_email_direction();
21
22
23 $wrapper_style .= TemplateHelpers::get_style(
24 [
25 'border-spacing' => '0',
26 'width' => '100%',
27 'direction' => $container_direction,
28 'min-width' => '100%',
29 'border-collapse' => 'separate',
30 ]
31 );
32
33 $border_style = isset( $element['data']['border'] ) ? TemplateHelpers::get_border_css_value( $element['data']['border'] ) : '';
34
35 if ( ! empty( $border_style ) && 'button' !== $element['type'] ) {
36 $wrapper_style .= $border_style;
37 }
38
39 $user_custom_classes = isset( $element['data']['custom_css_classes'] ) ? $element['data']['custom_css_classes'] : '';
40 $settings = yaymail_settings();
41 $margin = isset( $element['data']['margin'] ) ? $element['data']['margin'] : [];
42 $outer_style = TemplateHelpers::get_style(
43 [
44 'width' => '100%',
45 'margin' => TemplateHelpers::get_spacing_value( $margin ),
46 ]
47 );
48
49 if ( ! empty( trim( wp_kses_post( $content_html ) ) ) ) {
50 ?>
51 <div class="yaymail-element yaymail-element-<?php echo esc_attr( $element['id'] ); ?> <?php echo esc_attr( $user_custom_classes ); ?>" data-yaymail-element-type="<?php echo esc_attr( $element['type'] ); ?>" style="<?php echo esc_attr( $outer_style ); ?>" data-yaymail-element-id="<?php echo esc_attr( $element['id'] ); ?>">
52 <table cellpadding="0" cellspacing="0" class="yaymail-element__content" style="<?php echo esc_attr( $wrapper_style ); ?>">
53 <tbody>
54 <tr>
55 <td>
56 <style>
57 .yaymail-element__content p {
58 font-size: 14px;
59 margin: 0px;
60 }
61 </style>
62 <?php
63 yaymail_kses_post_e( $content_html );
64 ?>
65 </td>
66 </tr>
67 </tbody>
68 </table>
69 </div>
70 <?php
71 }//end if
72 ?>
73