PluginProbe
YayMail – WooCommerce Email Customizer / 3.3.5
YayMail – WooCommerce Email Customizer v3.3.5
4.4.6 4.4.5 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 All 57 releases
yaymail / includes / MailBuilder / YaymailElement.php

YaymailElement.php in YayMail – WooCommerce Email Customizer 3.3.5, at includes/MailBuilder/YaymailElement.php

332 lines 13.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YayMail\MailBuilder;
4
5 use YayMail\Helper\Helper;
6
7 defined( 'ABSPATH' ) || exit;
8 /**
9 * Settings Page
10 */
11 class YaymailElement {
12 protected static $instance = null;
13 public static function getInstance() {
14 if ( null == self::$instance ) {
15 self::$instance = new self();
16 self::$instance->doHooks();
17 }
18
19 return self::$instance;
20 }
21
22 private function doHooks() {
23 // BASIC
24 add_action( 'YaymailLogo', array( $this, 'yaymail_logo' ), 100, 6 );
25 add_action( 'YaymailImages', array( $this, 'yaymail_images' ), 100, 6 );
26 add_action( 'YaymailElementText', array( $this, 'yaymail_element_text' ), 100, 6 );
27 add_action( 'YaymailButton', array( $this, 'yaymail_button' ), 100, 6 );
28 add_action( 'YaymailTitle', array( $this, 'yaymail_title' ), 100, 6 );
29 add_action( 'YaymailSocialIcon', array( $this, 'yaymail_social_icon' ), 100, 6 );
30 add_action( 'YaymailVideo', array( $this, 'yaymail_video' ), 100, 6 );
31 add_action( 'YaymailHTMLCode', array( $this, 'yaymail_html_code' ), 100, 6 );
32 add_action( 'YaymailImageList', array( $this, 'yaymail_image_list' ), 100, 6 );
33 add_action( 'YaymailImageBox', array( $this, 'yaymail_image_box' ), 100, 6 );
34 add_action( 'YaymailTextList', array( $this, 'yaymail_text_list' ), 100, 6 );
35 // GENERAL
36 add_action( 'YaymailSpace', array( $this, 'yaymail_space' ), 100, 6 );
37 add_action( 'YaymailDivider', array( $this, 'yaymail_divider' ), 100, 6 );
38 add_action( 'YaymailOneColumn', array( $this, 'yaymail_one_column' ), 100, 6 );
39 add_action( 'YaymailTwoColumns', array( $this, 'yaymail_two_column' ), 100, 6 );
40 add_action( 'YaymailThreeColumns', array( $this, 'yaymail_three_column' ), 100, 6 );
41 add_action( 'YaymailFourColumns', array( $this, 'yaymail_four_column' ), 100, 6 );
42 // WOOCOMMERCE
43 add_action( 'YaymailShippingAddress', array( $this, 'yaymail_shipping_address' ), 100, 6 );
44 add_action( 'YaymailBillingAddress', array( $this, 'yaymail_billing_address' ), 100, 6 );
45 add_action( 'YaymailOrderItem', array( $this, 'yaymail_order_item' ), 100, 6 );
46 add_action( 'YaymailOrderItemDownload', array( $this, 'yaymail_order_item_download' ), 100, 6 );
47 add_action( 'YaymailHook', array( $this, 'yaymail_hook' ), 100, 6 );
48
49 }
50
51 public function yaymail_logo( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
52 ob_start();
53 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Logo.php';
54 $html = ob_get_contents();
55 ob_end_clean();
56 $html = do_shortcode( $html );
57 // Replace shortcode cannot do_shortcode
58 $reg = '/\[yaymail.*?\]/m';
59 $html = preg_replace( $reg, '', $html );
60 echo wp_kses_post( $html );
61 }
62
63 public function yaymail_images( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
64 ob_start();
65 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Images.php';
66 $html = ob_get_contents();
67 ob_end_clean();
68 $html = do_shortcode( $html );
69 // Replace shortcode cannot do_shortcode
70 $reg = '/\[yaymail.*?\]/m';
71 $html = preg_replace( $reg, '', $html );
72 echo wp_kses_post( $html );
73 }
74
75 public function yaymail_element_text( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
76 ob_start();
77 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ElementText.php';
78 $html = ob_get_contents();
79 ob_end_clean();
80 $html = do_shortcode( $html );
81 // Replace shortcode cannot do_shortcode
82 $reg = '/\[yaymail.*?\]/m';
83 $html = preg_replace( $reg, '', $html );
84 $allowed_html_tags = wp_kses_allowed_html( 'post' );
85 $allowed_html_tags['style'] = array();
86 echo wp_kses( $html, $allowed_html_tags );
87 }
88
89 public function yaymail_button( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
90 ob_start();
91 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Button.php';
92 $html = ob_get_contents();
93 ob_end_clean();
94 $html = do_shortcode( $html );
95 // Replace shortcode cannot do_shortcode
96 $reg = '/\[yaymail.*?\]/m';
97 $html = preg_replace( $reg, '', $html );
98 echo wp_kses_post( $html );
99 }
100 public function yaymail_title( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
101 ob_start();
102 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Title.php';
103 $html = ob_get_contents();
104 ob_end_clean();
105 $html = do_shortcode( $html );
106 // Replace shortcode cannot do_shortcode
107 $reg = '/\[yaymail.*?\]/m';
108 $html = preg_replace( $reg, '', $html );
109 echo wp_kses_post( $html );
110 }
111
112 public function yaymail_social_icon( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
113 ob_start();
114 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/SocialIcon.php';
115 $html = ob_get_contents();
116 ob_end_clean();
117 $html = do_shortcode( $html );
118 // Replace shortcode cannot do_shortcode
119 $reg = '/\[yaymail.*?\]/m';
120 $html = preg_replace( $reg, '', $html );
121 echo wp_kses_post( $html );
122 }
123
124 public function yaymail_video( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
125 ob_start();
126 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Video.php';
127 $html = ob_get_contents();
128 ob_end_clean();
129 $html = do_shortcode( $html );
130 // Replace shortcode cannot do_shortcode
131 $reg = '/\[yaymail.*?\]/m';
132 $html = preg_replace( $reg, '', $html );
133 echo wp_kses_post( $html );
134 }
135
136 public function yaymail_shipping_address( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
137 ob_start();
138 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ShippingAddress.php';
139 $html = ob_get_contents();
140 ob_end_clean();
141 $html = do_shortcode( $html );
142 // Replace shortcode cannot do_shortcode
143 $reg = '/\[yaymail.*?\]/m';
144 $html = preg_replace( $reg, '', $html );
145 echo wp_kses_post( $html );
146 }
147
148 public function yaymail_billing_address( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
149 ob_start();
150 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/BillingAddress.php';
151 $html = ob_get_contents();
152 ob_end_clean();
153 $html = do_shortcode( $html );
154 // Replace shortcode cannot do_shortcode
155 $reg = '/\[yaymail.*?\]/m';
156 $html = preg_replace( $reg, '', $html );
157 echo wp_kses_post( $html );
158 }
159
160 public function yaymail_order_item( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
161 ob_start();
162 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OrderItem.php';
163 $html = ob_get_contents();
164 ob_end_clean();
165 $html = do_shortcode( $html );
166 // Replace shortcode cannot do_shortcode
167 $reg = '/\[yaymail.*?\]/m';
168 $html = preg_replace( $reg, '', $html );
169 $allowed_html_tags = wp_kses_allowed_html( 'post' );
170 $allowed_html_tags['style'] = array();
171 echo wp_kses( $html, $allowed_html_tags );
172 }
173
174 public function yaymail_html_code( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
175 ob_start();
176 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/HTML.php';
177 $html = ob_get_contents();
178 ob_end_clean();
179 $html = do_shortcode( $html );
180 // Replace shortcode cannot do_shortcode
181 $reg = '/\[yaymail.*?\]/m';
182 $html = preg_replace( $reg, '', $html );
183 echo wp_kses_post( $html );
184 }
185
186 public function yaymail_image_list( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
187 ob_start();
188 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ImageList.php';
189 $html = ob_get_contents();
190 ob_end_clean();
191 $html = do_shortcode( $html );
192 // Replace shortcode cannot do_shortcode
193 $reg = '/\[yaymail.*?\]/m';
194 $html = preg_replace( $reg, '', $html );
195 echo wp_kses_post( $html );
196 }
197
198 public function yaymail_image_box( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
199 ob_start();
200 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ImageBox.php';
201 $html = ob_get_contents();
202 ob_end_clean();
203 $html = do_shortcode( $html );
204 // Replace shortcode cannot do_shortcode
205 $reg = '/\[yaymail.*?\]/m';
206 $html = preg_replace( $reg, '', $html );
207 echo wp_kses_post( $html );
208 }
209
210 public function yaymail_text_list( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
211 ob_start();
212 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/TextList.php';
213 $html = ob_get_contents();
214 ob_end_clean();
215 $html = do_shortcode( $html );
216 // Replace shortcode cannot do_shortcode
217 $reg = '/\[yaymail.*?\]/m';
218 $html = preg_replace( $reg, '', $html );
219 echo wp_kses_post( $html );
220 }
221
222 public function yaymail_order_item_download( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
223 ob_start();
224 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OrderItemDownload.php';
225 $html = ob_get_contents();
226 ob_end_clean();
227 $html = do_shortcode( $html );
228 // Replace shortcode cannot do_shortcode
229 $reg = '/\[yaymail.*?\]/m';
230 $html = preg_replace( $reg, '', $html );
231 echo wp_kses_post( $html );
232 }
233
234 public function yaymail_hook( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
235 ob_start();
236 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Hook.php';
237 $html = ob_get_contents();
238 ob_end_clean();
239 $html = do_shortcode( $html );
240 // Replace shortcode cannot do_shortcode
241 $reg = '/\[yaymail.*?\]/m';
242 $html = preg_replace( $reg, '', $html );
243 $allowed_html_tags = wp_kses_allowed_html( 'post' );
244 $allowed_html_tags['style'] = array();
245 echo wp_kses( $html, $allowed_html_tags );
246 }
247
248 public function yaymail_space( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
249 ob_start();
250 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Space.php';
251 $html = ob_get_contents();
252 ob_end_clean();
253 $html = do_shortcode( $html );
254 // Replace shortcode cannot do_shortcode
255 $reg = '/\[yaymail.*?\]/m';
256 $html = preg_replace( $reg, '', $html );
257 echo wp_kses_post( $html );
258 }
259
260 public function yaymail_divider( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
261 ob_start();
262 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Divider.php';
263 $html = ob_get_contents();
264 ob_end_clean();
265 $html = do_shortcode( $html );
266 // Replace shortcode cannot do_shortcode
267 $reg = '/\[yaymail.*?\]/m';
268 $html = preg_replace( $reg, '', $html );
269 echo wp_kses_post( $html );
270 }
271
272 public function yaymail_one_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
273 ob_start();
274 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OneColumn.php';
275 $html = ob_get_contents();
276 ob_end_clean();
277 $html = do_shortcode( $html );
278 // Replace shortcode cannot do_shortcode
279 $reg = '/\[yaymail.*?\]/m';
280 $html = preg_replace( $reg, '', $html );
281 $allowed_html_tags = wp_kses_allowed_html( 'post' );
282 $allowed_html_tags['style'] = array();
283 $allowed_html_tags = Helper::customAllowedHTMLTags( array( 'background' => true ) );
284 echo wp_kses( $html, $allowed_html_tags );
285 }
286
287 public function yaymail_two_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
288 ob_start();
289 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/TwoColumn.php';
290 $html = ob_get_contents();
291 ob_end_clean();
292 $html = do_shortcode( $html );
293 // Replace shortcode cannot do_shortcode
294 $reg = '/\[yaymail.*?\]/m';
295 $html = preg_replace( $reg, '', $html );
296 $allowed_html_tags = wp_kses_allowed_html( 'post' );
297 $allowed_html_tags['style'] = array();
298 $allowed_html_tags = Helper::customAllowedHTMLTags( array( 'background' => true ) );
299 echo wp_kses( $html, $allowed_html_tags );
300 }
301
302 public function yaymail_three_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
303 ob_start();
304 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ThreeColumn.php';
305 $html = ob_get_contents();
306 ob_end_clean();
307 $html = do_shortcode( $html );
308 // Replace shortcode cannot do_shortcode
309 $reg = '/\[yaymail.*?\]/m';
310 $html = preg_replace( $reg, '', $html );
311 $allowed_html_tags = wp_kses_allowed_html( 'post' );
312 $allowed_html_tags['style'] = array();
313 $allowed_html_tags = Helper::customAllowedHTMLTags( array( 'background' => true ) );
314 echo wp_kses( $html, $allowed_html_tags );
315 }
316
317 public function yaymail_four_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
318 ob_start();
319 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/FourColumn.php';
320 $html = ob_get_contents();
321 ob_end_clean();
322 $html = do_shortcode( $html );
323 // Replace shortcode cannot do_shortcode
324 $reg = '/\[yaymail.*?\]/m';
325 $html = preg_replace( $reg, '', $html );
326 $allowed_html_tags = wp_kses_allowed_html( 'post' );
327 $allowed_html_tags['style'] = array();
328 $allowed_html_tags = Helper::customAllowedHTMLTags( array( 'background' => true ) );
329 echo wp_kses( $html, $allowed_html_tags );
330 }
331 }
332